HI,
I am using TeeChart AX 2011.0.5 with custom axis and line series. The left axis is configured as Automatic for min and max values: as it is a percentage, the current range of values is 0..100. When the user zooms a series, the automatic properties of the left axis is deselected, the min value is changed to an high value not in the range e.g. 323.55 and the same thing happens to the max value. Is there any idea to avoid such behaviour?
Pascal
Zoom changes left axis property
Re: Zoom changes left axis property
Hi Pascal,
I'm not sure to understand what'd the exact configuration of your chart. Could you please arrange a simple example project we can runa s-is to reproduce the problem here?
Thanks in advance.
I'm not sure to understand what'd the exact configuration of your chart. Could you please arrange a simple example project we can runa s-is to reproduce the problem here?
Thanks in advance.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Zoom changes left axis property
Well, it is a little bit complicated because the chart is integrated in a solution with a database. May I send you a doc containing screen copies?
Re: Zoom changes left axis property
Hi Pascal,
Yes, some screen-shots may help us to understand the situation. However, sometimes this is not enough and we have to insist on getting a simple project :-S
You can attach your files directly here in the forums if you find it acceptable.
Yes, some screen-shots may help us to understand the situation. However, sometimes this is not enough and we have to insist on getting a simple project :-S
You can attach your files directly here in the forums if you find it acceptable.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Zoom changes left axis property
Hi Yeray,
I attached the screen copy of the Editor values before and after the 'user' has zoomed the chart.
How to understand these screen copies:
The first page of the document shows the initial values of the Editor after the chart is displayed. The customer uses the mouse to zoom a part of the chart.
The second the and third pages show that Left axis configuration changed after the user zoom.
Pascal
I attached the screen copy of the Editor values before and after the 'user' has zoomed the chart.
How to understand these screen copies:
The first page of the document shows the initial values of the Editor after the chart is displayed. The customer uses the mouse to zoom a part of the chart.
The second the and third pages show that Left axis configuration changed after the user zoom.
Pascal
- Attachments
-
- TeeChart v2011.0.5 - Zoom change Left Axis properties.zip
- (54.47 KiB) Downloaded 825 times
Re: Zoom changes left axis property
I upgrade the screen copies to show the chart before and after the zoom, from the solution.
Best regards,
Pascal
Best regards,
Pascal
- Attachments
-
- TeeChart v2011.0.5 - Zoom change Left Axis properties-Ed2.zip
- (164.78 KiB) Downloaded 883 times
Re: Zoom changes left axis property
Bonjour Pascal,
The top three vertical axes are custom axes and the last vertical axis, the signalized in red, is the default left axis. With it, I guess the zoom rectangle you drew with the mouse is something similar to the blue rectangle in the picture below. Am I right? Note that only the default axes (left, right, bottom, top) zoom automatically. That's why the three vertical axes on top aren't rescaled when you zoom.
And the same reason explains why the left axis takes (322.632, 395.789) as new scale. You are probably drawing the zoom rectangle where these values would be if the left axis was larger. An image usually explains more than thousand words: So, when you are drawing a zoom rectangle on the blue area, you are actually telling the left axis you want it to be rescaled to 322, 395. But there is no point in that scale for the pink series.. so nothing is shown.
You can draw a zoom rectangle anywhere in the ChartRect, but only the default axes are going to be rescaled by default. It doesn't matter if the default axes aren't defining the same zone.
Here it is a simple example trying to simulate the behaviour you are experiencing:
Now, if you only want to zoom horizontally and force all the vertical axes to maintain their initial scale you have two options:
1) Set the zoom direction to be horizontal so the default left axis won't zoom either:
2) Use another custom axis instead of the default left axis:
If the behaviour you'd expect isn't the above, please don't hesitate to let us know.
À bientôt!
The top three vertical axes are custom axes and the last vertical axis, the signalized in red, is the default left axis. With it, I guess the zoom rectangle you drew with the mouse is something similar to the blue rectangle in the picture below. Am I right? Note that only the default axes (left, right, bottom, top) zoom automatically. That's why the three vertical axes on top aren't rescaled when you zoom.
And the same reason explains why the left axis takes (322.632, 395.789) as new scale. You are probably drawing the zoom rectangle where these values would be if the left axis was larger. An image usually explains more than thousand words: So, when you are drawing a zoom rectangle on the blue area, you are actually telling the left axis you want it to be rescaled to 322, 395. But there is no point in that scale for the pink series.. so nothing is shown.
You can draw a zoom rectangle anywhere in the ChartRect, but only the default axes are going to be rescaled by default. It doesn't matter if the default axes aren't defining the same zone.
Here it is a simple example trying to simulate the behaviour you are experiencing:
Code: Select all
uses Series;
const nSeries = 4;
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
Chart1.View3D:=false;
Chart1.MarginLeft:=7;
for i:=0 to nSeries-1 do
begin
Chart1.AddSeries(TFastLineSeries);
Chart1[i].FillSampleValues();
if i = nSeries-1 then
begin
with Chart1.Axes.Left do
begin
StartPosition:=(100/nSeries)*i;
EndPosition:=(100/nSeries)*(i+1);
Axis.Color:=Chart1[i].Color;
end;
end
else
begin
Chart1.CustomAxes.Add;
Chart1[i].CustomVertAxis:=Chart1.CustomAxes[i];
with Chart1.CustomAxes[i] do
begin
StartPosition:=(100/nSeries)*i;
EndPosition:=(100/nSeries)*(i+1);
Axis.Color:=Chart1[i].Color;
end;
end;
end;
end;
1) Set the zoom direction to be horizontal so the default left axis won't zoom either:
Code: Select all
Chart1.Zoom.Direction:=tzdHorizontal;
Code: Select all
uses Series;
const nSeries = 4;
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
Chart1.View3D:=false;
Chart1.MarginLeft:=7;
for i:=0 to nSeries-1 do
begin
Chart1.AddSeries(TFastLineSeries);
Chart1[i].FillSampleValues();
Chart1.CustomAxes.Add;
Chart1[i].CustomVertAxis:=Chart1.CustomAxes[i];
with Chart1.CustomAxes[i] do
begin
StartPosition:=(100/nSeries)*i;
EndPosition:=(100/nSeries)*(i+1);
Axis.Color:=Chart1[i].Color;
end;
end;
// Chart1.Zoom.Direction:=tzdHorizontal;
end;
À bientôt!
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |