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

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Hardee
Newbie
Newbie
Posts: 22
Joined: Tue Nov 21, 2006 12:00 am

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

Post by Hardee » Mon Jul 30, 2007 7:50 pm

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;

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Tue Jul 31, 2007 8:12 am

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);
// ...
Marjan Slatinek,
http://www.steema.com

Hardee
Newbie
Newbie
Posts: 22
Joined: Tue Nov 21, 2006 12:00 am

Post by Hardee » Tue Jul 31, 2007 1:08 pm

Thanks so much. I sure didn't see that. Btw, its really cool to hear from someone in Slovenia.

Post Reply