Page 1 of 1

Adding points at runtime

Posted: Mon Jan 19, 2004 3:51 pm
by 8577662
I need to create a grouped bar diagram (MultiBar := mbSide) at runtime. This works fine as long as all groups have the same values.

For example, with this values all works fine, if I want to show these values grouped by month:

Product code Month Quantity produced
10 Jan 300
10 Feb 325
10 Mar 287
12 Jan 175
12 Feb 223
12 Mar 241
14 Jan 461
14 Feb 470
14 Mar 455


But if I have not for all months all products it won't work. Therefore with this values it won't work (missing product 12 in february):

Product code Month Quantity produced
10 Jan 300
10 Feb 325
10 Mar 287
12 Jan 175
12 Mar 241
14 Jan 461
14 Feb 470
14 Mar 455

I use the following code to create the chart:

with Chart.AddSeries(TBarSeries) do begin
Title := ProductCode
AddXY(GroupSortOrder, Quantity, Month);
end;

Where GroupSortOrder is a unique integer value for each month

Posted: Tue Jan 20, 2004 7:46 am
by Marjan
Hi.
But if I have not for all months all products it won't work.
Correct. In your case the easiest solution is to use AddNullXY method for missing data. This way you'll ensure data for all products for all months and the grouping/stacking will work correctly (again). So, first do a check if some points are missing and if they are, use AddNullXY method to add missing data as "null" points.