Is there anyone out there who is a dynamic charting guru?
I am trying to create a chart which shows 3 values per Y axis value. ie, i would like to show one chart for each vehicle, showing labour, parts and outwork for each mechanical system on that vehicle.
I have my values stacking, however i just cant seem to comprehend how to set the Y axis to each system.
I have 3 horizontal bar series into which i load the 3 values. How do i set the chart to show these 3 values for each system?
I am trying to create a chart which shows 3 values per Y axis value. ie, i would like to show one chart for each vehicle, showing labour, parts and outwork for each mechanical system on that vehicle.
I have my values stacking, however i just cant seem to comprehend how to set the Y axis to each system.
I have 3 horizontal bar series into which i load the 3 values. How do i set the chart to show these 3 values for each system?
Code:
HorizBarSeries := THorizBarSeries.Create(FChart);
BarParts := THorizBarSeries.Create(FChart);
BarLabour := THorizBarSeries.Create(FChart);
HorizBarSeries.BarStyle := bsRectGradient;
BarParts.BarStyle := bsRectangle;
BarLabour.BarStyle := bsRectangle;
HorizBarSeries.ParentChart := FChart;
BarParts.ParentChart := FChart;
BarLabour.ParentChart := FChart;
HorizBarSeries.ShowInLegend := False;
BarParts.ShowInLegend := false;
BarLabour.ShowInLegend := false;
HorizBarSeries.Marks.Style := smsLabelValue;
BarParts.Marks.Style := smsLabelValue;
BarLabour.Marks.Style := smsLabelValue;
HorizBarSeries.MultiBar := mbStacked;
BarParts.MultiBar := mbStacked;
BarLabour.MultiBar := mbStacked;
Randomize;
with FChart do
begin
SeriesList.Clear;
HorizBarSeries.Add(fOutWork, 'OutWork',
Random(2147483648));
BarParts.Add(fParts, 'Parts',
Random(2147483648));
BarLabour.Add(fLabour, 'Labour',
Random(2147483648));
SeriesList.Add(HorizBarSeries);
SeriesList.Add(BarParts);
SeriesList.Add(BarLabour);
with Title do
begin
Font.Size := 10;
Font.Color := clBlack;
Text.Clear;
Text.Add('Costs for ' + sRef);
end;
end;
{ Generate the Chart as a Bitmap }
Bitmap := FChart.TeeCreateBitmap(clWhite, Rect);
FJPEG.Assign(Bitmap);
//GOT TO SAVE EACH CHART AS A SEPERATE FILE OR THEY WILL ALL BE THE SAME
FJPEG.SaveToFile('c:\apache\icons\breakdownchart'
+ IntToStr(iThisSystem) + '.jpg');