tags:

views:

292

answers:

2

Ive got a MS Chart control and it works just fine except that I can't figure out how to "format" the Y-Axis. I am adding a lot of double numbers into a Serie but when the double numb are actually whole numbers (20.000000.....) the Y-Axis on my chart shows 20.

example: this serie :
12.32
11.00
10.13
would actually show up like this:
12.32
11
10.13

I have tried formatting the data as I insert it into the serie like this:

serie.Points.AddXY(date.ToString(),double[i].ToString("##.##"));

but that doesn't seem to work.

I've tried to search for a place to format it in Chart.Series[0].* and Chart.ChartAreas[0].* but I didn't find it there.

A: 

Use "0.00" as format string, "##.##" will strip zeros at the end

serie.Points.AddXY(date.ToString(),double[i].ToString("0.00"));
volody
A: 

Hi again, thanks for the reply.

Doing that formats the number that gets inserted into the serie of the chart, but I want to format the yAxis that gets displayed.

I took a screenshot of the graph so you can see what I'm trying to do:
the Graph (http://notendur.hi.is/bhs1/Graph.jpeg)

regards, Biggi

Bigginn
ehm, this was supposed to be a comment to volody's answer =/
Bigginn