Problem with FastLineSeries

TeeChart for ActiveX, COM and ASP
Post Reply
David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

Problem with FastLineSeries

Post by David » Thu Mar 16, 2006 10:54 am

Hi,

I was trying to realize a real time display of data using FastLineSeries in C++. At first, I studied the demo sample code of "fast delete and fast pen" and came out with my C++ code as
DrawGraph(double dSpeed)
{
double x=m_chart1.Series(0).GetXValues().GetLast()+1;
m_FLseries1.AddRealTime(x,dSpeed,"",clTeeColor);
}
where m_FLseries1 and m_chart1 are class variable and m_FLseries1 is defined as
m_FLseries1 = m_chart1.Series(0).GetAsFastLine();

The code is called every time a new dSpeed came in. When I run the program, an erro dialog pops up without any info and I can't close it unless ctrl-alt-del. Then I altered the code to
DrawGraph(double dSpeed)
{
m_nCounter++;
m_FLseries1.AddRealTime(m_nCounter,dSpeed,"",clTeeColor);
}
where m_nCounter is defined as a class variable. And it works.

Anyone knows why the first way can't work? The sample code in VB is given here:
YValue = .Series(s).YValues.Last + Rnd * 10 - 5
XValue = .Series(s).XValues.Last + 1
.Series(s).asFastLine.AddRealTime XValue, YValue, "", clTeeColor

Thanks in advance.

I am using VC++2003 and Teechart 7.0.0.6

David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

Post by David » Tue Mar 21, 2006 1:31 am

How come no reply?

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Thu Mar 30, 2006 7:53 am

Hi David,

have you tried to do the following checking ?

if (m_chart.Series(0).GetCount()>0) {
double x=m_chart.Series(0).GetXValues().GetLast()+1;
}

David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

Post by David » Thu Mar 30, 2006 8:03 am

Hi, Pep,

Yeah, I noticed it yesterday and I have tried a similiar way. It now works fine. Thanks anyway.

David

Post Reply