I have a windows form which has few parameters and a chart control which graphs it.
Those few parameters are a track bar, and I made it so that every time one of those track bar value changes, the graph gets updated.
However, I noticed that if I drag the track bar across, the chart drawing suddenly takes a lot of time.
How do I implement the graph so that the graph updates periodically? Say two seconds after application realizes no values are changing?
Thank you very much.
Add a
Timercontrol to your form. Set theIntervalproperty to 2000 (2 seconds). Every time any of the factors that affect the chart change, set the timer’sEnabledproperty to true. In the timer’sTickevent handler, set the timer’sEnabledproperty to false and then update the chart control.