Equal axis scales
Equal axis scales
How do I set equal axis scales so my map displays properly? When the map displays, it gets exanded out to fill the window, distorting the ratio of the x and y scales. I'm using pro version 5 with C++ Builder 6.
Hi, look here: Isometric axis and TeeChart Pro -
http://www.steema.com/support/teechart/ ... %20Pro.htm
http://www.steema.com/support/teechart/ ... %20Pro.htm
Thanks.
Had to modify it a bit by changing the HORZSIZE and VERTSIZE to HORZRES and VERTRES because Screen->Width and Screen->Height are in pixels and the SIZE variables are in millimeters. Below is the C++ code for the method.
Had to modify it a bit by changing the HORZSIZE and VERTSIZE to HORZRES and VERTRES because Screen->Width and Screen->Height are in pixels and the SIZE variables are in millimeters. Below is the C++ code for the method.
Code: Select all
void TInputForm::MakeISOAxis(TCustomChart *AChart)
{
double tmpX, tmpY, XRange, YRange, Offset, XYScreen;
if ((AChart->ChartHeight > 0)&&(AChart->ChartWidth > 0))
{
XRange = AChart->BottomAxis->Maximum - AChart->BottomAxis->Minimum;
YRange = AChart->LeftAxis->Maximum - AChart->LeftAxis->Minimum;
XYScreen = 1.0*(GetDeviceCaps(AChart->Canvas->Handle,HORZRES)/Screen->Width)
/(GetDeviceCaps(AChart->Canvas->Handle,VERTRES)/Screen->Height);
tmpX = XRange/AChart->ChartWidth;
tmpY = (YRange/AChart->ChartHeight)*XYScreen;
if (tmpX > tmpY)
{
if (tmpY != 0.0)
{
Offset = ((YRange*tmpX/tmpY)-YRange)/2.0;
AChart->LeftAxis->SetMinMax(AChart->LeftAxis->Minimum-Offset,
AChart->LeftAxis->Maximum+Offset);
}
}
else
{
if (tmpX != 0.0)
{
Offset = ((XRange*tmpY/tmpX)-XRange)/2.0;
AChart->BottomAxis->SetMinMax(AChart->BottomAxis->Minimum-Offset,
AChart->BottomAxis->Maximum+Offset);
}
}
}
}