Page 1 of 1

CursorTool / Chart Re-draw

Posted: Wed Oct 24, 2007 5:36 pm
by 8126230
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());            
        }

Posted: Thu Oct 25, 2007 10:52 am
by narcis
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.

Posted: Mon Oct 29, 2007 6:17 pm
by 8126230
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...

Posted: Tue Oct 30, 2007 12:56 pm
by narcis
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.