User (Legacy) Posted May 5, 2004 Report Share Posted May 5, 2004 I'm attempting to get the y-axis labeling on a bar chart to show number formats per some user settings. I managed to dig into AxisBase.LabelsFormat as the place to specify the formatting, and used the Culture property to feed in my own NumberFormatInfo via this method (by setting my custon NumberFormatInfo into the Culture.NumberFormat). This made the decimal separator work, but the number of decimals and the negative number formatting are ignored. So, if the NumberFormatInfo has been setup with a NumberNegativePattern of 0 (pattern is (n)), the axis doesn't do anything with it, it still shows a negative sign. And setting the NumberFormatInfo.NumberDecimalDigits also has no effect on the axis. Any help would be appreciated. Link to comment Share on other sites More sharing options...
Software FX Posted May 6, 2004 Report Share Posted May 6, 2004 The following code work for me: CultureInfo ci = new CultureInfo("en-us"); ci.NumberFormat.NumberNegativePattern = 0; chart1.AxisY.LabelsFormat.Culture = ci; chart1.AxisY.LabelsFormat.Format = AxisFormat.Number; -- FP Software FX Link to comment Share on other sites More sharing options...
User (Legacy) Posted May 6, 2004 Author Report Share Posted May 6, 2004 Thank you, I was missing the chart1.AxisY.LabelsFormat.Format = AxisFormat.Number; Once I added that, everyone works great. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.