This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I find when I set up axes in code the LabelFormat seems to not work. I made an example similar to Chart2 in the Zooming and Panning sample where I set up 2 charts that should be identical. The axes for the first chart are set up in XAML, and the axes for the second chart are set up in code. I specified LabelFormats of "{}{0:0.00}" in both cases, but when I run the program the second chart shows no decimal places in the labels. Here is my XAML <Grid> Here is the relevant code private void FillLFChart() lfChart2.XAxis = new ChartAxis() lfChart2.Series[0].ItemsSource = points; |
|
|
Hello In C# you will need to remove the first set of empty curly brackets from the string format. So this will be LabelFormat = "{0:0.00}". Remember to do this for both axes. The first set of empty curly brackets is a XAML trick, it means to treat the rest of the attribute as a string. This is important for setting string format properties because the curly bracket can mean other things in XAML. - Jason |
|
|
Hi Jason, Thanks for the information--I wasn't aware of what the {} means. Peter |
|