Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
375
Scatter chart, category axis and big number of points
posted

Now I have another problem.

I have 2 charts on the page, each should be a scatter chart (i.e. markers without lines), and the labels are strings. Number of points is around 1000 for each chart.

So I'm using LineSeries with CategoryXAxis, with some dummy points with value set to double.NaN.

The problem is that not all points are being displayed (as explained elsewhere on the forum, this is due to performance customization), even if I set series.Resolution property to 0.

Before I was using ScatterSeries, and since a CategoryXAxis cannot be assigned to it, I was keeping a list of labels (List<string>) and was doing the same trick as with using NumericAxis to display DateTime data, i.e. a DataTemplate with a textblock and a converter. The converter would use a value passed as a key to the list of labels to retrieve and draw the axis label. The problem with this approach is that inside the Converter it's only the value which is accessible, so I cannot access the list of labels. When there was only 1 chart on the page, I just made this list static, but with 2 charts it obviously doesn't work.

So, I'm a bit stuck.

To summarize: I need a scatter chart with 1000 points and string labels.
I cannot use LineSeries, because it would exclude some points from being drawn.
I cannot use ScatterSeries, because I cannot attach a CategoryXAxis to it, and the trick with assigning a DataTemplate with TextBlock and Converter to the XAxis.Label wouldn't work, since there are 2 charts, and I cannot access the chart's list of labels from the Converter.

Can you help me on this one?