c# - Update y-axis maximum in chart -
my english not apologize in advance.
tried object chart
in windowsformsapplication
.
built program looks this:
, code:
private void form1_load(object sender, eventargs e) { chart1.dock = dockstyle.fill; chart1.series.clear(); } private void button1_click(object sender, eventargs e) { chart1.series.clear(); chart1.series.add("button1 series"); (int = 1; <= 100; i++) chart1.series[0].points.addxy(i, * 2); } private void button2_click(object sender, eventargs e) { chart1.series.clear(); chart1.series.add("button2 series"); (int = 1; <= 100; i++) chart1.series[0].points.addxy(i, * 4); }
when click first button (button1
), graph displayed want:
if after hit second button (button2
), points on y-axis escape out:
maximum of y-axis (250) stay same instead change bigger.
how can fix program graph not out of area?
thanks, , sorry again english
you can use chart1.resetautovalues();
Comments
Post a Comment