Hello,
How do I change the space between the groups of bars on each day (or whatever time period)? The example shows the space between each bar group (red circle) that I want to make smaller.
Thanks!
Dave
Space between bar groups
Space between bar groups
- Attachments
-
- BarSpacing.png (30.47 KiB) Viewed 7781 times
Re: Space between bar groups
Hi Dave,
You could try setting a bigger BarWidthPercent for the TBarSeries in your chart.
Here it is a simple example using a TrackBar to modify this property:
You could try setting a bigger BarWidthPercent for the TBarSeries in your chart.
Here it is a simple example using a TrackBar to modify this property:
Code: Select all
uses Series;
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
for i:=0 to 3 do
Chart1.AddSeries(TBarSeries).FillSampleValues();
TrackBar1.Max:=100;
TrackBar1.Min:=0;
TrackBar1.Position:=(Chart1[0] as TBarSeries).BarWidthPercent;
TrackBar1.Frequency:=10;
end;
procedure TForm1.TrackBar1Change(Sender: TObject);
var i: Integer;
begin
for i:=0 to chart1.SeriesCount-1 do
(Chart1[i] as TBarSeries).BarWidthPercent:=TrackBar1.Position;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Space between bar groups
Hello Yeray,
Thanks for the reply.
I must be missing something as changing the BarWidthPercent does not have any effect on the bar chart. Is there a setting I need to change to enable BarWidthPercent?
Dave
Thanks for the reply.
I must be missing something as changing the BarWidthPercent does not have any effect on the bar chart. Is there a setting I need to change to enable BarWidthPercent?
Dave
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Space between bar groups
Hello Dave,
This works fine for me here with the attached project from the code Yeray posted. I'm using our latest TeeChart sources, which will be out on a new release very soon, which TeeChart version are you using? Does the project work fine for you?
This works fine for me here with the attached project from the code Yeray posted. I'm using our latest TeeChart sources, which will be out on a new release very soon, which TeeChart version are you using? Does the project work fine for you?
- Attachments
-
- BarWidthPercentTrackBar.zip
- (2.5 KiB) Downloaded 516 times
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Space between bar groups
Hi Narcis,
Yes, the project example you gave me works, but the same code does not work in my application. What I am wondering is if there is a setting that needs to be changed to allow the scaling of the BarWidthPercent. For example, an automatic scale that needs to be set to true or false?
Thanks,
Dave
Yes, the project example you gave me works, but the same code does not work in my application. What I am wondering is if there is a setting that needs to be changed to allow the scaling of the BarWidthPercent. For example, an automatic scale that needs to be set to true or false?
Thanks,
Dave
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Space between bar groups
Hi Dave,
In that case look at the .dfm in my project as text to see if there's any property that makes a difference.Dave Cox wrote: Yes, the project example you gave me works, but the same code does not work in my application.
Not that I can think of. Are you setting axes scales manually?Dave Cox wrote:What I am wondering is if there is a setting that needs to be changed to allow the scaling of the BarWidthPercent. For example, an automatic scale that needs to be set to true or false?
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |