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.
TChart VCL 7.04 Axis Title Clipped
Hi.
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:Thanks for your help and any workaround you may have
Code: Select all
void __fastcall TForm1::Chart1BeforeDrawChart(TObject *Sender)
{
Chart1->ChartRect.Left = 50;
}
Marjan Slatinek,
http://www.steema.com
http://www.steema.com