Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TChart (series data) question

Status
Not open for further replies.

mattcs

Technical User
Jul 21, 2002
32
AU
I am investigating the use of a TChart component and want to use data (derived from another object) in a corresponding TLineSeries.

From the help files etc, it seems that the AddXY() method is what I should use. Using the debugger stepping functions, I have ensured that the values are being read out of the data store (the object named "data") ready as parameters for the AddXY() method. Obviously the whole program Compiles and Links OK.

The problem is that the TLineSeries->Series1 object isn't reading in the values sent by the AddXY() method. When I use the debugger to look at the Series1 object there doesn't seem to be anything there and obviously nothing is printed on the TChart.

Here is the code that does the work:

void TGraphForm::SetSeriesData(void)
{
float hgt, val;
int count = data->count.size();

Series1->Clear();
//Series1->BeginUpdate();

for(int index = 0; index < count; index++)
{
hgt = data->height[index].ToDouble();
val = data->value[index].ToDouble();
Series1->AddXY(hgt, val);
}
//Series1->EndUpdate();
}

Perhaps I am not setting up either the TChart or TLineSeries objects correctly (except for axis values which are known and a 2D look). I am not familiar with either of these two and am pretty much &quot;taking the defaults&quot;.

Any comments or suggestions would be greatly appreciated. Thanks



Wisdom doesn't always come with age. Sometimes age comes alone.
 
I have a solution of sorts.

I simply deleted all traces of TChart v6 off my system and went with the 'standard' v4 TChart that comes with Builder.

I was using an evaluation version of TChart v6 and even building with run time packages etc didn't make any difference. Steema software has some good forums but you can't post unless you are registered.

I still don't know what the problem was but I now have a working version of my program with the TChart version that comes with Builder.

My advice; if you only want the basics then stick with the basic version.

- - - - - - - - - -

One further niggly problem though:

If I add a line - Series1->BeginUpdate() - I get a compiler error that BeginUpdate() is not a member of TChartSeries but the help file says that BeginUpdate() is a method of TLineSeries which descends from TChartSeries.



------------------------------
Wisdom doesn't always come with age. Sometimes age comes alone.
(you're never to old to learn)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top