Is this a proper behaviour?
I'm using a ScatterLineSeries with NumericXAxis.
I do not set explicite Intervals for the axis. For most cases it works great, soo my axis labels look like this:
| 1992, | 1993, | 1994, | 1995
(off course I'm using DataTemplate for the axis label).
Now, the issue is that, for small number of "x" values, the labels are duplicated!. So, I have this:
| 1992, | 1992, | 1993, | 1993
In other words, there are more labels than x values.
Is there some property to set in order to get rid of duplicated values?
I've double checked my data structures, and they seems fine.
Off course I could set Interval to 1 and have this issues solved, but the problem is that there can be thousands of values (then, having interval set to 1 makes my axis not really readable).
Czesc Lukasz,
You can hide labels with duplicated values by implementing visibility type converter and adding methods to handle chart’s SizeChanged and ActualWindowRectChange events. I created a sample application that hides labels with duplicated values and I also added another NumericXAxis so you can compare custom axis with default behavior of labels rendering.
Please let me know if you have more questions about this.
Thank you,
Martin
Hello Lukasz,
Were you able to resolve your issue with Axis labels?
-Martin
Thanks for the explanation (and sorry for the delay)
Actually I was having problems with your sample. I'm using WPF and your sample is for Silverlight.
Would that be a big effort to convert this sample to WPF world?
I converted my SL application to WPF and I attached it to this message. Let me know if you have more questions about it.
Did you review my updated sample and do you have any questions about?
Thank You Martin!
This is exactly what I needed.
Solution is a bit more complicated than I thought, but it works fine!