Thanks.
Here is my code. The first for loop should create the efficiency points centered on every bar of line 18. But nothing happens. For line 19 and 20 it works.
Code: Select all
var
i: integer;
PosValue: integer;
XValue: double;
begin
XValue := 0;
//****************************************************************************
// 2010
Series1.AddXY(1, 10000, 'Line 18');
// 2011
Series2.AddXY(1, 12500, 'Line 18');
// 2012
Series3.AddXY(1, 14000, 'Line 18');
// 2013
Series4.AddXY(1, 13500, 'Line 18');
//2014
Series6.AddXY(1, 11500, 'Line 18');
Chart1.Draw(Canvas,Chart1.ChartRect);
for i:=0 to Chart1.SeriesCount-2 do begin
PosValue:=Chart1[i].CalcXPos(0);
XValue:=Chart1.BottomAxis.CalcPosPoint(PosValue);
Series5.AddXY(XValue, 180 + (i*15));
end;
Series5.AddNullXY(XValue, 0);
//****************************************************************************
// 2010
Series1.AddXY(2, 10000, 'Line 19');
// 2011
Series2.AddXY(2, 12500, 'Line 19');
// 2012
Series3.AddXY(2, 14000, 'Line 19');
// 2013
Series4.AddXY(2, 13500, 'Line 19');
//2014
Series6.AddXY(2, 11500, 'Line 19');
Chart1.Draw(Canvas,Chart1.ChartRect);
for i:=0 to Chart1.SeriesCount-2 do begin
PosValue:=Chart1[i].CalcXPos(1);
XValue:=Chart1.BottomAxis.CalcPosPoint(PosValue);
Series5.AddXY(XValue, 180 + (i*15));
end;
Series5.AddNullXY(XValue, 0);
//****************************************************************************
// 2010
Series1.AddXY(3, 10000, 'Line 20');
// 2011
Series2.AddXY(3, 12500, 'Line 20');
// 2012
Series3.AddXY(3, 14000, 'Line 20');
// 2013
Series4.AddXY(3, 13500, 'Line 20');
//2014
Series6.AddXY(3, 11500, 'Line 20');
Chart1.Draw(Canvas,Chart1.ChartRect);
for i:=0 to Chart1.SeriesCount-2 do begin
PosValue:=Chart1[i].CalcXPos(2);
XValue:=Chart1.BottomAxis.CalcPosPoint(PosValue);
Series5.AddXY(XValue, 180 + (i*10));
end;
end;
So it works partial but is there any other solution right there, because the efficiency points are not centered correctly as you can see in this screenshot (to reproduce this, use the code above, and resize the form)?
Big Version:
Click here
I am looking forward to your reply. Thanks!