Chart offset when plotting stacked bar charts

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Errol
Newbie
Newbie
Posts: 75
Joined: Thu Jul 11, 2013 12:00 am

Chart offset when plotting stacked bar charts

Post by Errol » Fri May 01, 2015 6:00 am

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
Attachments
LineChart.png
LineChart.png (46.37 KiB) Viewed 6136 times
BarChart.png
BarChart.png (35.94 KiB) Viewed 6070 times

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Chart offset when plotting stacked bar charts

Post by Yeray » Tue May 05, 2015 8:01 am

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 6042 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?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Errol
Newbie
Newbie
Posts: 75
Joined: Thu Jul 11, 2013 12:00 am

Re: Chart offset when plotting stacked bar charts

Post by Errol » Tue Jul 07, 2015 5:23 am

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 5955 times
BarChartWithYTitle.jpg
BarChartWithYTitle.jpg (195.63 KiB) Viewed 5955 times

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Chart offset when plotting stacked bar charts

Post by Yeray » Tue Jul 07, 2015 9:24 am

Hi Errol,

Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply