CursorTool / Chart Re-draw

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
JHirsch
Newbie
Newbie
Posts: 16
Joined: Tue Jul 20, 2004 4:00 am
Location: USA

CursorTool / Chart Re-draw

Post by JHirsch » Wed Oct 24, 2007 5:36 pm

I'm evaluating the latest TeeChart for .NET...
I have two charts (ChartA, ChartB) setup exactly the same with a CursorTool on both charts. Moving the cursor on one Chart updates the Series data on the other Chart.
The odd behavior is that when moving the cursor on ChartA the cursor redraws very quickly but the Series data displayed in ChartB doesn't seem to redraw until the cursor in ChartA almost stops moving.
Also when moving the Cursor in ChartB the cursor redraws very slowly while the Series data in ChartA redraws very quickly.
I tried the FastCursor setting with poor results.

Any thoughts??

Code: Select all

//This is ChartA - Cursor.OnChange event which updates the Series in ChartB (tChartTrend)
void SCursor_Change(object sender, Steema.TeeChart.Tools.CursorChangeEventArgs e)
        {
            if (DataList.Count < e.XValue) return;
            if (TrendIndex == (int)e.XValue) return;
            TrendIndex = (int)e.XValue;
            
            tChartTrend.Series[0].Clear();
            tChartTrend.Series[0].Add(XAxis, DataList[TrendIndex].ToArray());
        }

//This is ChartB - Cursor.OnChange event which updates the Series in ChartA (tChartSpectral)
void TCursor_Change(object sender, Steema.TeeChart.Tools.CursorChangeEventArgs e)
        {                        
            if (DataList.Count < e.XValue) return;
            if (e.XValue <= 0) return;
            if (SpectralIndex == (int)e.XValue) return;
            SpectralIndex = (int)e.XValue;

            tChartSpectral.Series[0].Clear();
            tChartSpectral.Series[0].Add(XAxis, DataList[SpectralIndex].ToArray());            
        }

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Oct 25, 2007 10:52 am

Hi JHirsch,

Are you using latest TeeChart for .NET v3 maintenance release available at the client area? This includes some enhancements which may help.

If the problem persists, could you please send us a simple example project we can run "as-is" to reproduce the problem here?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

JHirsch
Newbie
Newbie
Posts: 16
Joined: Tue Jul 20, 2004 4:00 am
Location: USA

Post by JHirsch » Mon Oct 29, 2007 6:17 pm

I uploaded DuellingCharts.zip to your upload page...
It includes a workaround in the code also. I found that forcing the Charts to re-draw on every CusrorTool.OnChange event seems to work OK.

Thanks...

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Oct 30, 2007 12:56 pm

Hi JHirsch,

Thank you very much for the example project. In fact, what you call is not so much a workaround, as a requirement as that it's necessary because the chart only repaints when Invalidate is called (Refresh calls Invalidate) or when it is resized.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply