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
80
XamDataChart - Formatting axis labels using converter?
posted

In my WPF XamDataChart I am using a ScatterLineSeries - plotting a value against time.  I want to show time on the x axis and the value on the y axis.

For the ScatterLineSeries I must use NumericXAxis and NumericYAxis.  I have done, converting the DateTime value to Ticks (I've also tried using .ToOADate() too) to get a numerical value from the DateTime.

The series line itself looks fine and what I expect, but the labels on the x axis show the value in ticks.  I want to format this using the DateTime formatting (e.g. hh:mm:ss) to be something more meaningful.

How do I do this?  I've tried setting the x axis Label member to lots of variations of "{}{:hh:mm:ss}",  but none seem to work.  Ideally I'd like to use an IValueConverter, which can convert the value in Ticks to a DateTime, then create a string from that.  I'd also like to use an IValueConverter on the y axis too to convert some values to strings (e.g. 1 = Good, 2 = OK, 3 = Bad).

Thanks,

Mike

Parents Reply Children
No Data