Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2010 Chart control: Make Y Axis an Integer value, not decimal

I like the way that the chart control seems to automatically determine the X axis range for me based on the data, but in this case, the data can only be whole numbers.

What is the easiest way to specify whole numbers for this axis?

alt text

like image 307
Chad Avatar asked Nov 01 '10 13:11

Chad


2 Answers

Looks like you can do this by setting the YValueType property on any relevant series to an integer type - for example:

Chart.Series[0].YValueType = ChartValueType.Int32;
like image 76
DanS Avatar answered Nov 11 '22 00:11

DanS


    chartClicks.ChartAreas(0).AxisY.IntervalOffsetType = DateTimeIntervalType.Number
like image 2
Chad Avatar answered Nov 11 '22 01:11

Chad