Page 1 of 1

Chart offset when plotting stacked bar charts

Posted: Fri May 01, 2015 6:00 am
by 16566546
I use vertical stacked bar charts to plot well lithology, with a custom horizontal axis. This causes the whole chart to be offset to the right. Compare the position of the left vertical axis between a normal line chart and the bar chart. Can you suggest how I might address this.

Thanks

Errol

Re: Chart offset when plotting stacked bar charts

Posted: Tue May 05, 2015 8:01 am
by yeray
Hello,

This seems to work fine for me here:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Chart1.Axes.Left.Title.Caption:='Left Axis Title';

  for i:=0 to 4 do
    with Chart1.AddSeries(TBarSeries) as TBarSeries do
    begin
      FillSampleValues;
      MultiBar:=mbStacked;
      Marks.Visible:=false;
    end;
end;
LeftAxisTitleStackedBars.png
LeftAxisTitleStackedBars.png (24.69 KiB) Viewed 6043 times
Are you using the latest TeeChart version, v2015.15?
Could you please modify the code above or to arrange a simple example project we can run as-is to reproduce the problem here?

Re: Chart offset when plotting stacked bar charts

Posted: Tue Jul 07, 2015 5:23 am
by 16566546
Hi Yeray

Thanks for your reply to my last post and sorry for the delayed reply. I have since determined that the graph offset is caused by assigning a title to the left axis, using the following command:
YLabelDisplay := ldField;

ldField is the current display name of the axis. I use the same command to assign a title to the left axis of an ordinary line graph and this does not cause the graph to be offset, so I would be grateful if you could suggest a workaround for this problem.

I have attached two graphs showing the offset when a title axis is assigned.

Thanks and regards

Errol
BarChartWithNoYTitle.jpg
BarChartWithNoYTitle.jpg (241.03 KiB) Viewed 5956 times
BarChartWithYTitle.jpg
BarChartWithYTitle.jpg (195.63 KiB) Viewed 5956 times

Re: Chart offset when plotting stacked bar charts

Posted: Tue Jul 07, 2015 9:24 am
by yeray
Hi Errol,

Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.