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
Problem with FastLineSeries
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;
}
have you tried to do the following checking ?
if (m_chart.Series(0).GetCount()>0) {
double x=m_chart.Series(0).GetXValues().GetLast()+1;
}
Pep Jorge
http://support.steema.com
http://support.steema.com