Page 1 of 1

Problem with Custom Axis

Posted: Wed Jul 27, 2005 8:15 am
by 9342815
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

Posted: Thu Jul 28, 2005 10:26 am
by Pep
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;