views:

70

answers:

1

In our application we allow users to chart enum values over time. We want the values plotted on the y-axis according to their integer values. However, we want the y-axis labelled with localized strings. And we'd like the "tooltip" diplayed when you hover over a plotted point to display a localized string.

I thought this would be "simple" since the Chart Control apparently will graph any IComparable data. So I created an EnumValue class that implements IComparable (based on int value) but that has a property named Value (used for binding) that is of type String.

So I thought I had been very clever and attempted to graph my EnumValues. When trying to display the graph of EnumValues I was told that the Chart control could not find a suitable axis to display the data. This makes sense as my data can't be plotted with the default LinearAxis. (I mean where would it plot the value "Off").

My question, is their a simple way to do this (like providing a map from int values to strings that the chart will automagically use), or will I have to define my own subclass of RangeAxis (or DisplayAxis) that tells the Chart how to plot these EnumValues.

I think creating the EnumAxis wouldn't be too hard, but their isn't a lot of documentation on what the methods need to do. (although you can gather a lot of info by looking at the other implementations).

Note, I'm currently trying to do this with Silverlight Toolkit Chart Control. But am evaluating Telerik and Software FX as well.

thanks Michael

A: 

I did get this to work by creating my own Axis subclass.

Michael