Page 1 of 1

Newbie Help - Adding more than one Box plot to a chart

Posted: Mon Jul 30, 2007 7:50 pm
by 9348135
Hello,

I am having trouble doing what I'm sure should be perfectly straightforward. I would like to put multiple box plots on a chart. But the following code only appears to put the first one. Perhaps the others are behind it? There are three series created in this loop.

Thanks in advance.

Hardee Mahoney
Washington, DC

while Node <> nil do
begin
if (Node.Level <> 0) and (Node.Strings[5] = 'True') then
begin
BoxSeries := TBoxSeries.Create(nil);
BoxSeriesList.Add(BoxSeries);

BoxSeries.Clear;
for i := 0 to High(FAPVResults.BoxChartValues[NodeNum].FPercentiles) do
BoxSeries.AddXY(SeriesNum, FAPVResults.BoxChartValues[NodeNum].FPercentiles);

BoxSeries.Title := Node.Strings[6];
BoxSeries.XLabel[0] := Node.Strings[6];
BoxSeries.ParentChart := Chart1;
Inc(SeriesNum);
end;
Node := Node.GetNext;
Inc(NodeNum);
end;

Posted: Tue Jul 31, 2007 8:12 am
by Marjan
Hi.

Boxplot series horizontal position is controlled by it's Position property. For multiple boxplot series, you have to set each boxseries Position property to different value. The following code should work fine:

Code: Select all

BoxSeries := TBoxSeries.Create(nil);
BoxSeries.Position := SeriesNum;
BoxSeries.ParentChart := Chart1;
// ...
Inc(SeriesNum);
// ...

Posted: Tue Jul 31, 2007 1:08 pm
by 9348135
Thanks so much. I sure didn't see that. Btw, its really cool to hear from someone in Slovenia.