Hello,
I have a Stacked Bar Chart which displays values for 6 years into the future the problem that I have is when displaying the chart the last Bar is only half as wide as the other bars and I have the Series width set to 100% for all bars. When I add another year to the base data with zero values then the last bar width is ok, but then the bottom axis shows an addtional year with zero values which does not look very professional. Is there any way to force the last bar to be the same width as the other bars?
Thanks!
Bar Width for Stacked Bars
Bar Width for Stacked Bars
Regards,
CCRyder
CCRyder
Hi CCRyder,
I'm not able to reproduce the problem here with the following code. Could you please modify it in order to reproduce it? Or could you send us a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
I'm not able to reproduce the problem here with the following code. Could you please modify it in order to reproduce it? Or could you send us a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Code: Select all
uses series;
procedure TForm1.FormCreate(Sender: TObject);
var i, j: Integer;
begin
for i:=0 to 1 do
begin
Chart1.AddSeries(TBarSeries.Create(self));
for j:=0 to 5 do
Chart1[i].Add(random*500);
end;
(Chart1[0] as TBarSeries).MultiBar := mbStacked;
end;
procedure TForm1.Button1Click(Sender: TObject);
var i: Integer;
begin
for i:=0 to Chart1.SeriesCount-1 do
Chart1[i].Add(random*500);
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Bar Width for Stacked Bars
Hello Yeray,
I have uploaded a sample project for you to view. I was trying to correct the width by adding another empty datarow to the table and then adjusting the Bottom Axis offset but this confuses the user when entering data.
Thanks for your help!!
Best regards
I have uploaded a sample project for you to view. I was trying to correct the width by adding another empty datarow to the table and then adjusting the Bottom Axis offset but this confuses the user when entering data.
Thanks for your help!!
Best regards
Regards,
CCRyder
CCRyder
Hi Ryder,
Yes, it seems that having for example two Bar Series, and one of them with BarWidthPercent = 100 and not the other, the last bar of the first series isn't draw as BarWidthPercent = 100. I've added it to the wish list to be fixed in future releases (TV52014110).
Easy to reproduce with this:
Yes, it seems that having for example two Bar Series, and one of them with BarWidthPercent = 100 and not the other, the last bar of the first series isn't draw as BarWidthPercent = 100. I've added it to the wish list to be fixed in future releases (TV52014110).
Easy to reproduce with this:
Code: Select all
uses series;
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
for i:=0 to 1 do
begin
Chart1.AddSeries(TBarSeries.Create(self));
Chart1[i].FillSampleValues(5);
end;
(Chart1[0] as TBarSeries).BarWidthPercent := 100;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Bar Width for Stacked Bars
Hello Yeray,
Any ideas for a workaround until the next update?
Regards,
Any ideas for a workaround until the next update?
Regards,
Regards,
CCRyder
CCRyder
Hi Ryder,
The only workaround I can think right now is to add another series with a null value and adjust the axis:
The only workaround I can think right now is to add another series with a null value and adjust the axis:
Code: Select all
uses series;
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
for i:=0 to 1 do
begin
Chart1.AddSeries(TBarSeries.Create(self));
Chart1[i].FillSampleValues(5);
end;
(Chart1[0] as TBarSeries).BarWidthPercent := 100;
Chart1[0].AddNull();
Chart1.Axes.Bottom.AutomaticMaximum:=false;
Chart1.Axes.Bottom.Maximum:=Chart1[0].Count-1;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Bar Width for Stacked Bars
Hello Yeray,
Thanks for the info. It looks like this will do the trick until the change has been implemented.
Thanks for the info. It looks like this will do the trick until the change has been implemented.
Regards,
CCRyder
CCRyder