I am trying to graph a property of a class using some sort of a converter. It is really hard to explain so let me try with this pseudo-code example (note I'm not working with Files or even Sizes -- this is just the easiest example I could think of):
class FileSize {
ulong SizeInBytes{get;set;}
DateTime Date{get;set;}
}
I then have a SeriesMapping which maps the Date (XValue) to the SizeInBytes (YValue). However, I would want the Y Scale to be in MB, not B. Unfortunately the object is being returned from a WebService so the class is auto-generated, and Silverlight does not have extension properties, so I am unable to add a Property to the class which does the conversion for me. Is there a way to have the Chart perform the conversion for me? I could only think of three ways:
1) Inside the ItemMapping there is a place for something such as an IValueConverter (couldn't find that).
2) Inside the AxisY have something there which makes the values convert. (Didn't find anything here either).
3) Some sort of styling of the Vertical Axis to convert the value only on the Axis labels, not on the values themselves (most ideal for performance reasons). I couldn't drill down far enough to find anything I could add converters to a style for the 2D Y Axis.
Is there any way to achieve what I am looking for? Ideally I would like to format/convert the labels of the Axis. I really don't want to have to create a new object and iterate over thousands of objects in the list just so I can show a ulong as a float with decimals.
Travis
class FileSize {
ulong SizeInBytes{get;set;}
DateTime Date{get;set;}
}
I then have a SeriesMapping which maps the Date (XValue) to the SizeInBytes (YValue). However, I would want the Y Scale to be in MB, not B. Unfortunately the object is being returned from a WebService so the class is auto-generated, and Silverlight does not have extension properties, so I am unable to add a Property to the class which does the conversion for me. Is there a way to have the Chart perform the conversion for me? I could only think of three ways:
1) Inside the ItemMapping there is a place for something such as an IValueConverter (couldn't find that).
2) Inside the AxisY have something there which makes the values convert. (Didn't find anything here either).
3) Some sort of styling of the Vertical Axis to convert the value only on the Axis labels, not on the values themselves (most ideal for performance reasons). I couldn't drill down far enough to find anything I could add converters to a style for the 2D Y Axis.
Is there any way to achieve what I am looking for? Ideally I would like to format/convert the labels of the Axis. I really don't want to have to create a new object and iterate over thousands of objects in the list just so I can show a ulong as a float with decimals.
Travis