Hello,
Animated zoom doesn't zoom selected place when direction is set to both and animation step is above 5. It just miss selected area.
TeeChart version 2016.19
Best Regards,
Grzegorz
Animated zoom doesn't zoom selected place
Re: Animated zoom doesn't zoom selected place
Hello,
I'm not able to reproduce the problem here with the following simple example:
Could you please modify it so we can reproduce the problem here?
Thanks in advance.
I'm not able to reproduce the problem here with the following simple example:
Code: Select all
uses Series;
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
Chart1.Legend.Visible:=false;
Chart1.View3D:=false;
for i:=0 to 3 do
Chart1.AddSeries(TFastLineSeries).FillSampleValues;
Chart1.Zoom.Animated:=true;
Chart1.Zoom.AnimatedSteps:=6;
Chart1.Zoom.Direction:=tzdBoth;
end;
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: Animated zoom doesn't zoom selected place
Hello
I found the reason of the problem. It is because OnAxisZoom I try to zoom custom axis but i forgot to check if it's custom axis and set Min,Max for all axis.
So it's my fault, but I don't understand why there was no problem when animation was off. It look like Chart->Zoom->X0,X1,Y0,Y1 have different values when one switch animation on/off.
Best Regards,
Grzegorz
I found the reason of the problem. It is because OnAxisZoom I try to zoom custom axis but i forgot to check if it's custom axis and set Min,Max for all axis.
Code: Select all
for(int i=0; i<Chart->SeriesCount(); ++i)
{
if(Chart->Zoom->Direction == tzdBoth || Chart->Zoom->Direction == tzdHorizontal)
{
if(Chart->Series[i]->HorizAxis == aCustomHorizAxis)//<-----------I forgot to check that it's custom
{
TChartAxis* pTCustomHorizontalAxes = Chart->Series[i]->GetHorizAxis;
if(pTCustomHorizontalAxes)
{
double aMin = pTCustomHorizontalAxes->CalcPosPoint(Chart->Zoom->X0);
double aMax = pTCustomHorizontalAxes->CalcPosPoint(Chart->Zoom->X1);
pTCustomHorizontalAxes->Automatic = false;
pTCustomHorizontalAxes->SetMinMax(aMin,aMax);
}
}
}
if(Chart->Zoom->Direction == tzdBoth || Chart->Zoom->Direction == tzdVertical)
{
if(Chart->Series[i]->VertAxis == aCustomVertAxis)//<-----------I forgot to check that it's custom
{
TChartAxis* pTCustomVerticalAxes = Chart->Series[i]->GetVertAxis;
if(pTCustomVerticalAxes)
{
double aMin = pTCustomVerticalAxes->CalcPosPoint(Chart->Zoom->Y0);
double aMax = pTCustomVerticalAxes->CalcPosPoint(Chart->Zoom->Y1);
pTCustomVerticalAxes->Automatic = false;
pTCustomVerticalAxes->SetMinMax(aMin,aMax);
}
}
}
}
Best Regards,
Grzegorz