I want to use MSDN graphics to represent the real-time data that I get from a telnet application. For testing purposes, I added a button to manually modify the chart. I manually made a chart, and it has 0 to 5 points on the X axis with the values of different values on X. The series is called "Series1" by default.
I tried the following:
chart1.Series ["Series1"] Points.ElementAt (0) .SetValueY (40). // Nothing happens
chart1.Series ["Series1"]. Points.ElementAt (1) .SetValueXY (1, 20); // Nothing happens
chart1.Series ["Series1"] Points [0] .SetValueY (40). // Nothing happens
chart1.Series ["Series1"]. Points.ElementAt (1) .YValues.SetValue (10, 0); // Nothing happens
chart1.Series ["Series1"] Points.Clear () .// Deletes all the necessary points.
So how do I change the data records in runtime?
-EDIT- If I change the point with chart1.Series["Series1"].Points.ElementAt(0).SetValueY(40);and add a point after that with chart1.Series["Series1"].Points.AddXY(1, 40);, the changed point snaps the changed place into it. The conclusion is that the change changes the value of the Y point, but the graph is not updated. The AddXY () function seems autorefresh. I cannot find a way to call Refresh () manually.
source
share