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 "taking the defaults".
Any comments or suggestions would be greatly appreciated. Thanks
Wisdom doesn't always come with age. Sometimes age comes alone.
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 "taking the defaults".
Any comments or suggestions would be greatly appreciated. Thanks
Wisdom doesn't always come with age. Sometimes age comes alone.