Problem with Custom Axis

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Nico
Newbie
Newbie
Posts: 8
Joined: Thu Jul 21, 2005 4:00 am
Location: France

Problem with Custom Axis

Post by Nico » Wed Jul 27, 2005 8:15 am

Hi

I'd like to use a custom axis instead of the default bottom axis but when I do it, it seems that the label of this axis has no size.
The height of the graph increases so the label goes outside of the component.

Here is a screenshot wich comes from the TeeChart demo.
Image

When I set the bottom axis visibility to false, the yellow axis label is outside of the component space.

Is it a bug or am I doing something wrong ?

Thanks
Nico

Pep
Site Admin
Site Admin
Posts: 3299
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Thu Jul 28, 2005 10:26 am

Hi Nico,

it's not a bug. Custom axes don't support the LabelsSize. The workaround is to manually readjust ChartRect before you draw chart elements. I think the best place where you can do this is in TChart OnBeforeDrawChart event:

Code: Select all

procedure TForm1.Chart1BeforeDrawChart(Sender: TObject);
begin
TCustomChart(Sender).ChartRect.Bottom := TCustomChart(Sender).ChartRect.Bottom- 30; { add extra space on bottom edge }
end;

Post Reply