MSChart: Label format

Dumitru picture Dumitru · Jun 6, 2011 · Viewed 24.4k times · Source

How can I format chart label? I need to see only 2 digits after point.

I try chart.ChartAreas.First().AxisY.LabelStyle.Format = "#.##"; and 0.00

Also I try to set Series[0].LabelFormat = "0.00" and #.##

and without success.

What is wrong?

current chart

Answer

Cain picture Cain · Jun 8, 2011

Try setting .AxisX.LabelStyle.Format to "{0:0.00}" - I had to do it recently on one of my charts so it should work.