Zooming with Multiple Y axes in TChart 2010

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
JMX Services
Newbie
Newbie
Posts: 5
Joined: Fri Jul 09, 2010 12:00 am

Zooming with Multiple Y axes in TChart 2010

Post by JMX Services » Thu Aug 12, 2010 7:34 pm

I have a problem with T-Chart 2010 on zooming with multiple Y axes. When I zoom, it zooms all the waveforms to a common y-axis. I loose the various scalings on the independent axes. I can turn off vertical zooming and the horizontal zooming works correctly for my single x-axis, but I would like to be able to zoom the same way I could with the RAD Studio 2007 version of the TChart component. Is there a setting to enable this? As I am upgrading to 2010, I have had to copy and pastes the charts in my applications to get the projects to compile without errors. Has this copy and paste changed the default zoom settings. It did add a gradient to my panel backgrounds that I had to remove. Is there a bug here?

Thanks for your help!

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Zooming with Multiple Y axes in TChart 2010

Post by Yeray » Fri Aug 13, 2010 1:36 pm

Hi JMX Services,
JMX Services wrote:I have a problem with T-Chart 2010 on zooming with multiple Y axes. When I zoom, it zooms all the waveforms to a common y-axis. I loose the various scalings on the independent axes. I can turn off vertical zooming and the horizontal zooming works correctly for my single x-axis, but I would like to be able to zoom the same way I could with the RAD Studio 2007 version of the TChart component. Is there a setting to enable this?
The zoom for Custom axis has to be done manually calling SetMinMax routine at OnZoom and UndoZoom as explainmed in this FAQ.
Here it is an example:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Chart1.View3D:=false;

  for i:=0 to 3 do
  begin
    Chart1.AddSeries(TFastLineSeries);
    Chart1[i].FillSampleValues();
    Chart1.CustomAxes.Add;
    Chart1[i].CustomVertAxis:=Chart1.CustomAxes[i];
  end;
end;

procedure TForm1.Chart1UndoZoom(Sender: TObject);
var i: Integer;
begin
  for i:=0 to Chart1.CustomAxes.Count-1 do
    with Chart1.CustomAxes[i] do Automatic:=true;
end;

procedure TForm1.Chart1Zoom(Sender: TObject);
var i: Integer;
begin
  for i:=0 to Chart1.CustomAxes.Count-1 do
    with Chart1.CustomAxes[i] do SetMinMax(CalcPosPoint(Chart1.Zoom.Y1),CalcPosPoint(Chart1.Zoom.Y0));
end;
JMX Services wrote:As I am upgrading to 2010, I have had to copy and pastes the charts in my applications to get the projects to compile without errors.
You could simply open your RAD 2007 projects in RAD 2010, can't you? This way the neither the code or the forms should be changed.
JMX Services wrote:Has this copy and paste changed the default zoom settings. It did add a gradient to my panel backgrounds that I had to remove. Is there a bug here?
Dropping a chart into a form, it adds a chart with a gradient in the panel since TeeChart VCL 2010. That was made to improve the appearance of the initial charts. A similar improvement was made in TeeChart v8 when the initial palette passed to be the OperaPalette.
I doesn't affect project upgrades from previous versions as this info is stored in the dfm.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply