Hi, im filling a teechart which contains 4 series based on values from a listview's subitems[x] property.
However it only seems to work with one of the series, it ignores the rest (will only ever populate one series at a time).
The series are:
LeftBicepSeries
RightBicepSeries
LeftForearmSeries
RightForearmSeries
The chart is to show if any training i do makes how much of a differece.
now if i call it like so it only updates the first series (if i comment LeftBicepSeries out it only shows RightBicepSeries etc)
So i basically want to know why i cant update the teechart and all series at the same time??
Thanks!
However it only seems to work with one of the series, it ignores the rest (will only ever populate one series at a time).
The series are:
LeftBicepSeries
RightBicepSeries
LeftForearmSeries
RightForearmSeries
The chart is to show if any training i do makes how much of a differece.
Code:
procedure TfrmMain.UpdateLeftBicepSeries;
var
i: Integer;
aStringList: TStringList;
begin
try
aStringList:= TStringList.Create;
with LeftBicepSeries do
begin
Clear; //clear previous entries otherwise it will keep adding
{loop through each entry in the weight training table and:
-> get the value entered in all muscle part boxes
-> add to the weight training chart the number of months based on if each muscle part has a value}
for i:= 0 to lvwWeightTrainingTable.Items.Count do
begin
if lvwWeightTrainingTable.Items[i].SubItems.Count > 5 then
begin
if lvwWeightTrainingTable.Items[i].SubItems[5] <> '' then
begin
{add muscle part values to stringlist}
aStringList.Add(lvwWeightTrainingTable.Items[i].SubItems[5]);
{add to the chart, we can now count actual months via aStringList.Count}
Add(StrToFloat(lvwWeightTrainingTable.Items[i].SubItems[5]), IntToStr(aStringList.Count), clNone);
end;
end;
end;
end;
finally
aStringList.Free;
end;
end;
procedure TfrmMain.UpdateRightBicepSeries;
var
i: Integer;
aStringList: TStringList;
begin
try
aStringList:= TStringList.Create;
with LeftBicepSeries do
begin
Clear; //clear previous entries otherwise it will keep adding
{loop through each entry in the weight training table and:
-> get the value entered in all muscle part boxes
-> add to the weight training chart the number of months based on if each muscle part has a value}
for i:= 0 to lvwWeightTrainingTable.Items.Count do
begin
if lvwWeightTrainingTable.Items[i].SubItems.Count > 6 then
begin
if lvwWeightTrainingTable.Items[i].SubItems[6] <> '' then
begin
{add muscle part values to stringlist}
aStringList.Add(lvwWeightTrainingTable.Items[i].SubItems[6]);
{add to the chart, we can now count actual months via aStringList.Count}
Add(StrToFloat(lvwWeightTrainingTable.Items[i].SubItems[6]), IntToStr(aStringList.Count), clNone);
end;
end;
end;
end;
finally
aStringList.Free;
end;
end;
procedure TfrmMain.UpdateLeftForearmSeries;
var
i: Integer;
aStringList: TStringList;
begin
try
aStringList:= TStringList.Create;
with LeftBicepSeries do
begin
Clear; //clear previous entries otherwise it will keep adding
{loop through each entry in the weight training table and:
-> get the value entered in all muscle part boxes
-> add to the weight training chart the number of months based on if each muscle part has a value}
for i:= 0 to lvwWeightTrainingTable.Items.Count do
begin
if lvwWeightTrainingTable.Items[i].SubItems.Count > 7 then
begin
if lvwWeightTrainingTable.Items[i].SubItems[7] <> '' then
begin
{add muscle part values to stringlist}
aStringList.Add(lvwWeightTrainingTable.Items[i].SubItems[7]);
{add to the chart, we can now count actual months via aStringList.Count}
Add(StrToFloat(lvwWeightTrainingTable.Items[i].SubItems[7]), IntToStr(aStringList.Count), clNone);
end;
end;
end;
end;
finally
aStringList.Free;
end;
end;
procedure TfrmMain.UpdateRightForearmSeries;
var
i: Integer;
aStringList: TStringList;
begin
try
aStringList:= TStringList.Create;
with LeftBicepSeries do
begin
Clear; //clear previous entries otherwise it will keep adding
{loop through each entry in the weight training table and:
-> get the value entered in all muscle part boxes
-> add to the weight training chart the number of months based on if each muscle part has a value}
for i:= 0 to lvwWeightTrainingTable.Items.Count do
begin
if lvwWeightTrainingTable.Items[i].SubItems.Count > 8 then
begin
if lvwWeightTrainingTable.Items[i].SubItems[8] <> '' then
begin
{add muscle part values to stringlist}
aStringList.Add(lvwWeightTrainingTable.Items[i].SubItems[8]);
{add to the chart, we can now count actual months via aStringList.Count}
Add(StrToFloat(lvwWeightTrainingTable.Items[i].SubItems[8]), IntToStr(aStringList.Count), clNone);
end;
end;
end;
end;
finally
aStringList.Free;
end;
end;
now if i call it like so it only updates the first series (if i comment LeftBicepSeries out it only shows RightBicepSeries etc)
Code:
UpdateLeftBicepSeries;
UpdateRightBicepSeries; {not showing in chart}
UpdateLeftForearmSeries; {not showing in chart}
UpdateRightForearmSeries; {not showing in chart}
So i basically want to know why i cant update the teechart and all series at the same time??
Thanks!