Adding 2nd Y-axis and shifting chart w no change in size

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
MTW
Newbie
Newbie
Posts: 21
Joined: Thu Jun 28, 2007 12:00 am

Adding 2nd Y-axis and shifting chart w no change in size

Post by MTW » Mon Nov 24, 2008 8:12 pm

I have defined a chart of a fixed size. I would like to be able to add a custom vertical axis to the left of the graph. I want the graph (bottom axis) length to remain unchanged. I can make the chart wider, but I do not want the bottom axis to change with the new chart size. How can I do this?

Thank you for your assistance.
M Weingarden

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Dec 01, 2008 2:11 pm

Hi MTW,

You could have same axis size assigning a custom ChartRect when the chart is bigger, for example:

Code: Select all

procedure TForm1.BitBtn2Click(Sender: TObject);
var
 xx : TRect;
begin
with Chart1 do
begin
  xx := ChartRect;
  Width := Chart1.Width + 150;  // makes the chart bigger...
  CustomChartRect := true;
  ChartRect := xx;
  Axes.Left.LabelsSize:=-10;
  Axes.Bottom.LabelsSize:=-10;
end;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply