Performance issue of dynamically adding point to a C# chart -
i have big chart has more 16000+ points. while dynamically adding point end of chart, chart facing heavy redraw job. when data frequency rather high, chart dead , cpu on full load.
do have idea optimize performance?
is there possibility have chart redraw new part not whole chart? use addxy add new point set. can see long add dynamic code program stucked.
fullchart.series["lastpriceseries"].points.addxy(time, mktdata.lastprice); fullchart.series["highseries"].points.addxy(time, mktdata.askprice1); fullchart.series["lowseries"].points.addxy(time, mktdata.bidprice1); fullchart.series["volumeseries"].points.addxy(time, volume);
thanks in advance.
there several tips optimize mscharts.
please try enclose portion of code add point by
myserie.points.suspendupdates(); ... myserie.points.resumeupdates();
16000 points lot. optimization technique consists in using decimation algorithm limits amount of displayed points actual width of graph.
i suggest keep points needed in array, example, resample smaller array using moving average or bypassing amount points. it's fast process.
then, resulting array can bound directly mschart serie.
Comments
Post a Comment