c# - Update y-axis maximum in chart -


my english not apologize in advance.
tried object chart in windowsformsapplication.
built program looks this: enter image description here
, 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: button1
if after hit second button (button2), points on y-axis escape out:button2
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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -