wuttrain Posted April 29, 2008 Report Share Posted April 29, 2008 Hi, I noticed that repainting of the chart is really slow and freezes my form while it's repainting. I believe I have more than 200,000 points plotted to the chart. Here is what I did, when I queried the data, I put the query process and setting of the data source in a thread. The querying process seems to work, so threading is working but when loading the table to this (in the same thread): Me.Chart1.DataSource = [dataTable], it seems to freeze the screen, it then releases it when it's done. Is there a work around to this? My application has MDI windows and each window has charts that need to refresh every 5-10 minutes, and the refresh issue is going to kill my app. Thanks! wuttrain Quote Link to comment Share on other sites More sharing options...
Frank Posted April 29, 2008 Report Share Posted April 29, 2008 Like any Windows Form control, Chart FX is single threaded. You can't set any chart property from any thread other than the UI thread. You need to determine whether this time is spent reading the data or painting the chart by measuring how long does chart.DataSource = [dataTable] takes to return. If the time is beign spent during data loading, check the structure of your data to make sure it is optimal. If the time is beign spent during paint, the only thing you can do is simplify your chart so that it takes less CPU. Here are some pointers to improve the performance of your chart during paint: - If using a chart with markers, consider eliminating the markers or chosing a less complex marker (Rect is the fastest). - Use 2D over 3D - Consider scrolling - Avoid PointLabelOrganizer Quote Link to comment Share on other sites More sharing options...
wuttrain Posted April 29, 2008 Author Report Share Posted April 29, 2008 Yes, it's this line that is really freezing my form: Me.Chart1.DataSource = [dataTable] I already assigned markers to none and had all properties assigned to minimum (basing from what I read from the forums), but it is still slow. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.