Page 1 of 1

Change the position of Axes title

Posted: Thu Oct 16, 2008 12:50 pm
by 10045570
I have a chart and want to move the left axes title to the top of the chart and not centered as it comes by default and the botom axes title to the left of the axes and not centered. I could not find an option to the settings of the tiles in axes like Alignment option in the titles of the Chart.
Is there a way to do it????
Where can i upload a picture of the chart to be more specific????
Regards
Alex

Posted: Thu Oct 16, 2008 1:21 pm
by narcis
Hi Alex,

I'm afraid this is not possible for now. You'd better draw your own text on the chart's canvas like this:

Code: Select all

procedure TForm1.Chart1AfterDraw(Sender: TObject);
var leftStr, bottomStr: String;
begin
  leftStr:=Chart1.Axes.Left.Title.Caption;
  bottomStr:=Chart1.Axes.Bottom.Title.Caption;

  Chart1.Canvas.RotateLabel(Chart1.Axes.Left.Title.ShapeBounds.Left,
                            Chart1.Axes.Left.IEndPos,leftStr,90);

  Chart1.Canvas.TextOut(Chart1.Axes.Bottom.IStartPos,
                        Chart1.Axes.Bottom.Title.ShapeBounds.Top,bottomStr);

  Chart1.Axes.Left.Title.Visible:=false;
  Chart1.Axes.Bottom.Title.Visible:=false;

  Chart1.MarginBottom:=8;
  Chart1.MarginLeft:=5;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.Draw;
end;

Posted: Thu Oct 16, 2008 2:03 pm
by 10045570
Will it be available in a future version???? because the axes title is problem when you make a chart like cross and the 2 axes interect in 0,0 point. An option like alignment will be nice like chart title alignment

Posted: Thu Oct 16, 2008 2:09 pm
by narcis
Hi Alex,

This already an item in the wish-list to be considered for inclusion in future releases.