65.9K
CodeProject is changing. Read more.
Home

Flicker free MSChart

starIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIconemptyStarIcon

1.16/5 (20 votes)

Oct 5, 2003

viewsIcon

52070

A simple way to stop Flickering in MSChart.

Setting the DrawMode to 1

Introduction

This solves the problem of Flickering while the Chart values are updated rapidly.

Using the code

The trick is to set the mschart property DrawMode to 1 as shown in the picture. We need to do one more thing, set the Redraw to false just before updating the chat values and set ReDraw to true and also GetUpdated region and Invalidate the updated region.

<CODE>
m_ChartControl.SetRedraw(false) ; 
//.........code to update the Chart goes here
//.........................
CRgn rgn; 
m_ChartControl.GetUpdateRgn(&rgn); 
m_ChartControl.SetRedraw(true); 
m_ChartControl.InvalidateRgn(&rgn,false) ;
 

Points of Interest

Hope this helps for all those you looking for non-flickering charts.

History

None as of now!!

Thanks!!

Happy codeing!!!