TChart VCL 7.04 Axis Title Clipped

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
BYOB
Newbie
Newbie
Posts: 4
Joined: Fri Apr 22, 2005 4:00 am
Location: California, USA

TChart VCL 7.04 Axis Title Clipped

Post by BYOB » Sat May 14, 2005 9:37 pm

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.

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Tue May 17, 2005 8:08 am

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;
}
Marjan Slatinek,
http://www.steema.com

Post Reply