Hello. I'm using a particular value n for the major tickmark interval for my XamDataChart. I want the tickmarks to be displayed as exact multiples of that interval (-3n, -2n, -n, 0, n, 2n, etc.) For example, if I've set the Y axis display range to be from -135.2 to 380.7, and I set my intervals to display at multiples of 100.0, I would like the major tickmarks to be at:
-100.0, 0.0, 100.0, 200.0, 300.0
However, the chart currently positions the tickmarks at:
-135.2, -35.2, 64.8, 164.8, 264.8, 364.8.
Is there a SIMPLE way to set the initial position of the tickmarks so there is guaranteed to be a major tickmark at zero? I'm not trying to force the zero tickmark to always be drawn (i.e. if my data were from 320 to 720, I wouldn't see the mark at 0.0, but would want to see lines at 400, 500, 600, 700, as if the intervals BEGAN at zero). I know I could create my own TickmarkValues subclass, but this seems like a lot of work for what should be a default feature of a graph.
Thanks,
Ed
Hello Ed,
I have sent your Product Idea (Tickmarks from zero) directly to our product management team. Our product team chooses new Product Ideas for development based on popular feedback from our customer base. Infragistics continues to monitor application development for all of our products, so as trends appear in requested ideas, we can plan accordingly.
We value your input, and our philosophy is to enhance our toolset based on customer feedback. If your idea is chosen for development, you will be notified at that time. Your reference number for this Product Idea is PI13060064
If you would like to follow up on your Product Idea at a later point, you may contact Developer Support management via email. Please include the reference number of your Product Idea in the subject and body of your email message. You can reach Developer Support management through the following email address: dsmanager@infragistics.com
Thank you for your request.
Thanks, Stefan. I ended up using that page, and creating an IEnumerable<double> that returns the ticks between the minimum and maximum range:
public static IEnumerable<double> RangeEnumerator(double start, double end, double interval) { //Get the two values evenly divisible by the interval that lie within the range. int firstInterval = (int)Math.Ceiling((Math.Min(start, end) / interval)); int lastInterval = (int)Math.Floor((Math.Max(start, end) / interval)); return Enumerable.Range(firstInterval, lastInterval - firstInterval + 1).Select(i => i * interval); }
If there isn't a property of the XamDataChart that can be set to force intervals to be spaced from zero, I'd like to request that one be added as a feature.
Thank you for your post. I have been looking into it and I can suggest you see this link from our online documentation:
http://help.infragistics.com/Help/NetAdvantage/WPF/2012.1/CLR4.0/html/xamDataChart_Creating_Custom_Axis_Tickmark_Values.html
where it is shown step by step how to create custom tickmarks. Also I can say that you can calculate the values based on your axis interval and populate the Tickmarks collection with the appropriate values.
Hope this helps you.