Page 1 of 1

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

Posted: Mon Nov 24, 2008 8:12 pm
by 10045810
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

Posted: Mon Dec 01, 2008 2:11 pm
by narcis
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;