When using TeeShape and the XYStyle set to xysAxisOrigin. The value enter for the number of pixels can be interrupted as a minimum or maximum value for the axis. If X0 is 1200 Y0 is 37.87 X1 is 15 and Y1 is 15, then the minimum for the X-Axis (Bottom) is 15 and for the Left Axis is 15. While I really what the shape to be centered at 1200 and be 15 pixels wide. You are almost forced to use xysAxis
and set X0,Y0 and calculate the width and set these values to X1 and Y1
Mike DuPree
Automatic Axis Incorrect With TeeShapes
Re: Automatic Axis Incorrect With TeeShapes
Hi,
With the code below:
I get this:
If I scroll the chart a bit to the down-left, I see the shape:
So, as you say, the axes seem to be wrongly scaled.
You can centre the shape with this:
With the code below:
Code: Select all
uses TeeShape;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.View3D:=false;
with Chart1.AddSeries(TChartShape) as TChartShape do
begin
XYStyle:=xysAxisOrigin;
X0:=1200;
Y0:=37.87;
X1:=15;
Y1:=15;
end;
end;
You can centre the shape with this:
Code: Select all
uses TeeShape;
procedure TForm1.FormCreate(Sender: TObject);
var tmp: Double;
begin
Chart1.View3D:=false;
with Chart1.AddSeries(TChartShape) as TChartShape do
begin
XYStyle:=xysAxisOrigin;
X0:=1200;
Y0:=37.87;
X1:=15;
Y1:=15;
end;
Chart1.Draw;
with Chart1.Axes.Left do
begin
tmp:=(Maximum-Minimum)/2;
SetMinMax(Minimum+tmp, Maximum+tmp);
end;
with Chart1.Axes.Bottom do
begin
tmp:=(Maximum-Minimum)/2;
SetMinMax(Minimum+tmp, Maximum+tmp);
end;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |