Flickering ChartListBox
Flickering ChartListBox
HI,
I am using a 2D Line chart and updating it in real-time by adding points on the end of several series (12 to be exact). I could not figure out how to get a vertical scrollbar into a legend, so I used the ChartListBox and associated it with the chart control. This works as desired, but there is constant flickering in the listbox and I am assuming that the action of adding points is casuing this. Any suggestions on how to fix this problem? I have tried setting the ControlStyle of the parent form to double buffering, etc. but that did not help my situation.
Thanks,
Jim
I am using a 2D Line chart and updating it in real-time by adding points on the end of several series (12 to be exact). I could not figure out how to get a vertical scrollbar into a legend, so I used the ChartListBox and associated it with the chart control. This works as desired, but there is constant flickering in the listbox and I am assuming that the action of adding points is casuing this. Any suggestions on how to fix this problem? I have tried setting the ControlStyle of the parent form to double buffering, etc. but that did not help my situation.
Thanks,
Jim
Hi Jim,
Could you please post the code you're using here so I can see if it can be solved ?
I cannot reproduce the problem here (I don't see the fickering) using the latest release available on our web site and the following code :flickering in the listbox and I am assuming that the action of adding points is casuing this. Any suggestions on how to fix this problem? I have tried setting the ControlStyle of the parent form to
Code: Select all
private void Form1_Load(object sender, System.EventArgs e)
{
for (int i=0;i<13;i++)
{
tChart1.Series.Add (new Steema.TeeChart.Styles.Line());
tChart1.Series[i].FillSampleValues(10);
tChart1.Legend.Visible = false;
chartListBox1.Chart = tChart1;
}
private void timer1_Tick(object sender, System.EventArgs e)
{
Random a = new Random();
for (int i=0;i<13;i++)
{
tChart1.Series[i].Add(a.Next(10));
}
}
Pep Jorge
http://support.steema.com
http://support.steema.com
I figured it out. The flickering is a result of the way I have bundled the chart and chart list box into a class to contain them. The theory is that when the chart updates its axes, it causes a repaint for the whole class, thus making the chart list box flicker. I have tried a few ways to resolve the flickering but have been unsuccessful so far.
Jim
Jim
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi Jim,
I'm afraid I can't see any flickering when clicking the button.
I followed your instructions adding a button onto the panel with the following code:More info for you. The easiest way to see this problem is create a form, then put a panel in the form. Put a TChart into the panel and then put a ChartListBox into the same panel. Adding points onto the graph at any interval will make the ChartListBox flicker.
Code: Select all
private void button1_Click(object sender, System.EventArgs e) {
tChart1.Series.Add(new Steema.TeeChart.Styles.Line());
tChart1.Series[tChart1.Series.Count - 1].FillSampleValues();
}
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi Jim,
Try commenting out the line:
currentLine.fastLine.Color = graphColor;
in the AddPoint() method of your EquationGraph.
This property only needs to be set once, not each time you add a point in.
Try commenting out the line:
currentLine.fastLine.Color = graphColor;
in the AddPoint() method of your EquationGraph.
This property only needs to be set once, not each time you add a point in.
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi Jim,
1. Download TestGraphFlickerApp.zip from the message on news://www.berneda.com/steema.public.attachments with the subject "Flicker Chartlistbox example for Pep Take 3".
2. Run the project "as-is" - the ChartListBox flickering can clearly be seen.
3. Comment out the line currentLine.fastLine.Color = graphColor; - the ChartListBox flickering can clearly not be seen.
Can you reproduce this behaviour at your end using the same TeeChart for .NET version?
If you are still experiencing problems, please upload a fresh project I can run "as-is" to:
news://www.berneda.com/steema.public.attachments
Many thanks!
It does here. These are the steps I followed (all using TeeChart for .NET v1.1.1644.16795, the latest publicly available version):I have corrected that problem (setting the color each time) since I sent the sample to you and it still does not solve the flickering problem.
1. Download TestGraphFlickerApp.zip from the message on news://www.berneda.com/steema.public.attachments with the subject "Flicker Chartlistbox example for Pep Take 3".
2. Run the project "as-is" - the ChartListBox flickering can clearly be seen.
3. Comment out the line currentLine.fastLine.Color = graphColor; - the ChartListBox flickering can clearly not be seen.
Can you reproduce this behaviour at your end using the same TeeChart for .NET version?
If you are still experiencing problems, please upload a fresh project I can run "as-is" to:
news://www.berneda.com/steema.public.attachments
Many thanks!
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Hi Chris,
Thanks. With that clue I figured it out in my main application and all is working. The only remaining issue that would be nice to have fixed but is not critical is that when I initially set the color of the lines, the chartlistbox flickers as a result of this change. So basically, if I have 12 series, it flickers 12 times then is displayed normally.
Does the chartlistbox component have double buffering enabled ? For example:
Thanks,
Jim
Thanks. With that clue I figured it out in my main application and all is working. The only remaining issue that would be nice to have fixed but is not critical is that when I initially set the color of the lines, the chartlistbox flickers as a result of this change. So basically, if I have 12 series, it flickers 12 times then is displayed normally.
Does the chartlistbox component have double buffering enabled ? For example:
Code: Select all
this.SetStyle( ControlStyles.DoubleBuffer |
ControlStyles.ResizeRedraw |
ControlStyles.AllPaintingInWmPaint |
ControlStyles.UserPaint, true);
this.UpdateStyles();
Jim
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi Jim,
Can you not set AutoRepaint to false to avoid this problem?
No, it doesn't. The ChartListBox inherits from the standard System.Windows.Forms.ListBox whose default setting for double buffering is false.Does the chartlistbox component have double buffering enabled ?
Can you not set AutoRepaint to false to avoid this problem?
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Hi Chris,
I am a little confussed at your reply. The Chart Listbox does not have a publicly accessible property of AutoRepaint. The TeeChart does have this property and setting it to false has no effect on the flickering problem of the Chart Listbox.
The only reason I asked about double-buffering is that the flickering is a well documented problem with listbox controls and derived controls.
See:
http://msdn.microsoft.com/library/defau ... lsamp4.asp
Since you have a custom control ChartListBox you could add double-buffering easily.
I tried the other available method of using the Chart Listbox BeginUpdate/EndUpdate pair of methods and did not see any difference in the flickering.
Thanks,
Jim
I am a little confussed at your reply. The Chart Listbox does not have a publicly accessible property of AutoRepaint. The TeeChart does have this property and setting it to false has no effect on the flickering problem of the Chart Listbox.
The only reason I asked about double-buffering is that the flickering is a well documented problem with listbox controls and derived controls.
See:
http://msdn.microsoft.com/library/defau ... lsamp4.asp
Since you have a custom control ChartListBox you could add double-buffering easily.
I tried the other available method of using the Chart Listbox BeginUpdate/EndUpdate pair of methods and did not see any difference in the flickering.
Thanks,
Jim