Maximum X Height of LeftAxis
-
- Newbie
- Posts: 20
- Joined: Wed Jul 11, 2001 4:00 am
- Location: Bavaria
- Contact:
Maximum X Height of LeftAxis
Hello support team,
i would like to increment the maximum x value of the leftaxis.
LeftAxis maximum is set to automatic.
When all bars added to the chart i would like to increment the leftaxis with 10% of there size.
Example:
Maximum = 1000
Increment = 100
New maximum = 1100
How can i realize that?
Thanks.
i would like to increment the maximum x value of the leftaxis.
LeftAxis maximum is set to automatic.
When all bars added to the chart i would like to increment the leftaxis with 10% of there size.
Example:
Maximum = 1000
Increment = 100
New maximum = 1100
How can i realize that?
Thanks.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi AchatSolutions,
You have 2 options:
1. Manually setting axis maximum like this:
2. Using MaximumOffset property, for example:
You have 2 options:
1. Manually setting axis maximum like this:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
for i:=0 to 10 do
Series1.Add(i*100);
Chart1.Axes.Left.Increment:=100;
Chart1.Axes.Left.AutomaticMaximum:=false;
Chart1.Axes.Left.Maximum:=Series1.MaxYValue*1.1;
end;
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
for i:=0 to 10 do
Series1.Add(i*100);
Chart1.Axes.Left.Increment:=100;
Chart1.Draw;
Chart1.Axes.Left.MaximumOffset:=Chart1.Axes.Left.IAxisSize div 10;
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 |
-
- Newbie
- Posts: 20
- Joined: Wed Jul 11, 2001 4:00 am
- Location: Bavaria
- Contact:
Thanks for that. I am sorry for my bad description... so i am trying to explain it one more time:
Heres an screenshot that demonstrates my problem:
Big version
As you can see in this screenshot the first bar with its mark is out of the chart box. So the left axis is set to 3000. But i would like that the maximum is 10 percent higher. So the mark will be completly in the chart box. Thats the reason why i would like to increment the left axis maximum.
I am using delphi 6 and teechart pro 5.02.
So how can i do this?
Heres an screenshot that demonstrates my problem:
Big version
As you can see in this screenshot the first bar with its mark is out of the chart box. So the left axis is set to 3000. But i would like that the maximum is 10 percent higher. So the mark will be completly in the chart box. Thats the reason why i would like to increment the left axis maximum.
I am using delphi 6 and teechart pro 5.02.
So how can i do this?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi AchatSolutions,
The code I posted does exactly what you request. Which exact problem are you having with your TeeChart version? You may need to replace Axes.Left for LeftAxis.
The code I posted does exactly what you request. Which exact problem are you having with your TeeChart version? You may need to replace Axes.Left for LeftAxis.
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 |
-
- Newbie
- Posts: 20
- Joined: Wed Jul 11, 2001 4:00 am
- Location: Bavaria
- Contact:
I have tried it one more time:
1. solution: doesn' affect to the maximum size of the grid. Only the displayed steps in the left axis changed to 100. And i dont know the highest bar of my chart. So i cant use this solution.
2. solution: The function doesnt exist in my version.
I am sorry, hope you can help me one more time.
Thanks!
1. solution:
Code: Select all
Chart.Increment :=100;
2. solution: The function
Code: Select all
Chart.Axes.Left.MaximumOffset
I am sorry, hope you can help me one more time.
Thanks!
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi AchatSolutions,
The code below works fine for me here using v5.03.
Please notice that Increment property belongs to the axes not to the chart. Regarding MaximumOffset, it's not supported in v5, it was implemented in later versions, current version is number 8.
The code below works fine for me here using v5.03.
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
for i:=0 to 10 do
Series1.Add(i*100);
Chart1.LeftAxis.Increment:=100;
Chart1.LeftAxis.AutomaticMaximum:=false;
Chart1.LeftAxis.Maximum := Series1.MaxYValue * 1.1;
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 |
-
- Newbie
- Posts: 20
- Joined: Wed Jul 11, 2001 4:00 am
- Location: Bavaria
- Contact:
Thanks, but his line does not work:
Thats because i have several bar series. And i dont know which one is the highest.
Id like to check out whats the highest point of the chart and then add 10 % to this value. So all marks will be in the chart box and i can print it.
Code: Select all
Chart1.LeftAxis.Maximum := Series1.MaxYValue * 1.1;
Id like to check out whats the highest point of the chart and then add 10 % to this value. So all marks will be in the chart box and i can print it.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi AchatSolutions,
In that case the easiest solution would be letting left axis doing this calculation for you, for example:
In that case the easiest solution would be letting left axis doing this calculation for you, for example:
Code: Select all
Chart1.LeftAxis.SetMinMax(0,1000);
Caption:=FloatToStr(Chart1.MaxYValue(Chart1.LeftAxis));
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 |