I have a series chart that displays data in a frequency domain. The data values along the x-axis are very precise, which cases awkward labeling along the x-axis.
I know I can use formatting to clean up the numbers a bit, but I'd rather have custom labeling for more "sensible" labeling steps. For example, in this case, I'd like labels at "1000", "2000", "3000", 4000", "5000" and "6000", even though I don't have data points that correspond to those values. Is it possible to layer in custom labels that do not correspond to the available data points? The only thing I found close to something like this was the custom ticks, but CategoryXAxis doesn't support those. I have a hunch that what I'll need to do is remove labeling from this x-axis, and add another x-axis that contains the values corresponding to the labels I want. Is that right? Is there an easier way that doesn't involve multiple axes?
Thanks
Jason
Hi, it sounds like this approach might solve my problem too -- is there any sample on how to use NumericXAxis on top of a CategoryXAxis please?
thanks,
Guo
Hello,
I'm glad this works for you.
Let me know if you have any other questions.
Sincerely,
Lazar Nikolov
Infragistics
www.infragistics.com/support
Removing labeling from the CategoryXAxis and adding a NumericXAxis for labeling will work for what I need. I have an algorithm to determine the best interval, and the data is uniform. Thanks for the help.
Hello Jason,
You are correct that NumericXAxis supports only ScatterSeries.
To have a reasonable labeling you can use category axis without labels and, on top, a numeric axis that will provide you with many options to control the label setting. In code behind, or thru binding, you can set the minimum/maximum values and the interval of the numeric axis. However, this approach will work only if you have always numeric data for the X axis and the data is regularly distributed across the axis. If you have data points with categories 1, 2, 10 and these point are consecutive, this will not give the best result since the interval between 1 and 2 has to be the same as the interval between 2 and 10 on the axis line, and you will not achieve this by using numeric axis.
This seems to be the only reasonable resolution of you problem.
If this doesn't suits your needs and you still have reasons to avoid numeric axis, you can submit a product idea through our web site product idea submission form - http://ideas.infragistics.com/forums/192363-wpf.
Please let me know if I can provide any further assistance.
Hello Lazar,
Thank you for the response. Unfortunately, using the DataTemplate to round off the numbers won't suffice for this application. I cannot have the labels be misplaced; it throws off the users perception of the data.
I did look into NumericXAxis when I initially approached this, but from what I could tell, it's only supported with a ScatterSeries. This won't work for me, because I need to support Area and Column style charting.
My scenario can be recreated easily by having any data points with arbitrary x-axis values (1.3, 2.7, 3.2, etc.) and then attempting to produce labels at the round value locations (1,2,3,etc.). But if it would be helpful for me to provide a project that does this, I can put something together.