Steema Products Order About us Downloads Support

 

Isometric axis and TeeChart Pro


The example unit below shows how to adjust axis to be "isometric".

Download this unit:  isoaxis.zip  (3b)


// Call this function with a Chart or DBChart component
// to adjust the axis scales isometrically:
//
// MakeISOAxis( Chart1 );

procedure
MakeIsoAxis(AChart:TCustomChart);
var tmpX,tmpY,XRange,YRange,Offset,XYScreen:Double;
begin
  With
AChart do
  if (ChartHeight>0) and (ChartWidth>0) then
  begin
    With BottomAxis do XRange:=Maximum-Minimum;
    With LeftAxis do YRange:=Maximum-Minimum;

    XYScreen:=1.0*(GetDeviceCaps(Canvas.Handle,HORZSIZE)/Screen.Width)/
(GetDeviceCaps(Canvas.Handle,VERTSIZE)/Screen.Height);

    tmpX:=(XRange/ChartWidth);
    tmpY:=(YRange/ChartHeight)*XYScreen;

    if tmpX>tmpY then
    begin
      if tmpY<>0 then
      begin

        Offset:=((YRange*tmpX/tmpY)-YRange)/2.0;
        With LeftAxis do SetMinMax(Minimum-Offset,Maximum+Offset);
      end;
    end
    else
    if tmpX<>0 then
    begin
      Offset:=((XRange*tmpY/tmpX)-XRange)/2.0;
      With BottomAxis do SetMinMax(Minimum-Offset,Maximum+Offset);
    end;
  end;
end;
 

Home Products Order About us Downloads Support
Copyright information. E-MAIL info@steema.com.   Privacy Policy
All other brands and product names are trademarks or registered trademarks of their respective owners.