Hi,
I have a problem with the title of left axis. Sometimes the title is overlapping the labels, as you can see on this screenshoot :
[img]
http://cjoint.com/data/cjqDEF8DHg.htm
[/img]
I don't understand why .... as I set TChartAxis.TitleSize = 0 this must not happen.
Any solutions for this problem ?
Thanks
Franck
the title of left axis is overlapping the labels
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Franck,
Yes, this is a known problem. In the meantime, you can solve that by setting the axis labels size:
Yes, this is a known problem. In the meantime, you can solve that by setting the axis labels size:
Code: Select all
Chart1.Axes.Left.LabelsSize:=30;
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Franck,
Yes, as I told you, it's a known bug and it is already on our defect list to be fixed for future releases.
Yes, as I told you, it's a known bug and it is already on our defect list to be fixed for future releases.
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 |
Hi,
I have the same problem, and setting the LabelsSize to a constant isn't a workaround to the bug. There needs to be a way to calculate how much space is used, and then add some to that.
Is there a way to determine the amount of space that is allocated to the axis labels so that we can add a little padding?
Regards,
Bill
I have the same problem, and setting the LabelsSize to a constant isn't a workaround to the bug. There needs to be a way to calculate how much space is used, and then add some to that.
Is there a way to determine the amount of space that is allocated to the axis labels so that we can add a little padding?
Regards,
Bill
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Bill,
Yes, you can do something like this:
Yes, you can do something like this:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
for i:=0 to Chart1.SeriesCount-1 do
Chart1[i].FillSampleValues();
Chart1.Axes.Left.Title.Caption:='My left axis title';
Chart1.Draw;
end;
procedure TForm1.Chart1GetAxisLabel(Sender: TChartAxis;
Series: TChartSeries; ValueIndex: Integer; var LabelText: String);
begin
if Sender=Chart1.Axes.Left then
if (StrLen(PChar(LabelText))*4)>Chart1.Axes.Left.LabelsSize then
Chart1.Axes.Left.LabelsSize:=StrLen(PChar(LabelText))*4;
end;
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Bill,
You can make this constant dependant of the font size or whatever you consider can affect that. It was just an idea to try to give a better workaround for the issue.It looks like you are assuming four pixels per character, but that won't always be the case.
This event is actually fired for all axes labels displayed but the code will only be executed for the left axis labels.In addition, using this event will be slow when there are a large number of points. It would probably work if only the labels being displayed triggered the event, but that isn't the case.
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 |