Page 1 of 1

ViewXY: Axis scaling fix with 3 decimal places

Posted: Mon Aug 04, 2014 10:00 am
by Felix
Hello Pasi,

how can I set in a bar chart, the X-axis always has 3 decimal places.

The X-axis has been drawn from Custom ticks.
I have tried to adjust the settings,

Code: Select all

_chart.ViewXY.XAxes [0] AutoFormat labels = true; 
_chart.ViewXY.XAxes [0] Label Number Format = "0.000"; 
but then the custom ticks was not displayed correctly.
BarChartAxis.PNG
BarChartAxis.PNG (18.04 KiB) Viewed 5699 times

Re: ViewXY: Axis scaling fix with 3 decimal places

Posted: Mon Aug 04, 2014 10:16 pm
by ArctionPasi
Hi Felix,

you should use axis.AutoFormatLabels = false, and set the value as string to each CustomAxisTick separately.

customAxisTick.LabelText = customAxisTick.AxisValue.ToString("0.000");