Page 1 of 1

TChart VCL 7.04 Axis Title Clipped

Posted: Sat May 14, 2005 9:37 pm
by 9341715
My project includes a TChart that includes two custom left axes along with the LeftAxis. It is a simple 2D chart using line series. One, two, or three left axes can be visible at any given time.

When the LeftAxis is not visible, the custom left axes have their labels clipped due there not being enough margin.

It looks as if the code responsible is in CalcAxisRect, part of the TCustomAxisPanel.InternalDraw procedure. This in the line:

Get(tmp).CalcRect(OldR,tmp<5); { <-- inflate only for first 5 axes }

This, I assume, would be the standard left, right, top, bottom, and depth axes. If the standard LeftAxis is not visible, then the axis label does not appear to be accounted for. :(

I don't want to change this code because I am afrain of what side effects there may be.

Thanks for your help and any workaround you may have.

BYOB.

Posted: Tue May 17, 2005 8:08 am
by Marjan
Hi.
Thanks for your help and any workaround you may have
For custom axes for the time being you still have to adjust chart drawing region (defined by ChartRect) manually. In your case you'll havet to define ChartRect.Left value. The best place for this is in the TChart:OnBeforeDrawChart event:

Code: Select all

void __fastcall TForm1::Chart1BeforeDrawChart(TObject *Sender)
{
  Chart1->ChartRect.Left = 50;
}