Define X-Axis (CategoryAxis) items separately

Aug 25, 2009 at 8:17 AM

hey guys,

first of all, the charting components are great! Thank you for offering that.

Now to my question. I have a bubble-series chart. The X-Axis is a CategoryAxis, that means an axis with string-labels. The Y-Axis is a LinearAxis. When I add a new BubbleSeries to the chart, then the control automatically sets the axis-labels from the chart data.
This behavior is great for the Y-axis (LinearAxis) in my case, but not for the X-axis. I want to define the labels for the X-axis by myself, because the data for the chart not always contains all labels, therefore I want to define them by myself.

How is that possible?


Aug 25, 2009 at 9:45 PM

What you really want sounds like an ItemsSource property on CategoryAxis that you can use to provide a list of labels. But we don't have that. :( However, you could insert a *second* Series that had invisible DataPoints (Visibility=Collapsed) and provided the complete list of categories you want. It's not the most elegant thing, but it should work without much difficulty. :)

Hope this helps!

Aug 26, 2009 at 7:40 PM

hey davidans!

Thank you for your reply. The way you described was my first solution. But it wasn't the cleanest solution for me, so I tought I would find a better solution here. But when the functionallity of axis source isn't implementeted, then I will use this solution.

Thank you!