Hi Guys,
I have read a lot of posts stating that the Polar Series cannot be zoomed. I looked in the Examples application Tee6New.exe and I found if one selects the Tab -> All features and then Chart Styles->Extended->Polar (Click on polar) it is possible to Zoom the Chart shown on the right. How can this be done in a C++ Application?
Thanks a lot,
Stoyan
Polar Series Zoom
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Stoyan,
You can try using ZoomRect, for example:
You can try using ZoomRect, for example:
Code: Select all
void __fastcall TForm1::FormMouseWheel(TObject *Sender, TShiftState Shift,
int WheelDelta, TPoint &MousePos, bool &Handled)
{
if(WheelDelta > 0)
{
Chart1->ZoomRect(Rect(Chart1->Axes->Bottom->CalcXPosValue(0)+5,
Chart1->Axes->Left->CalcYPosValue(Chart1->Axes->Left->Maximum)+5,
Chart1->Axes->Bottom->CalcXPosValue(Chart1->Axes->Bottom->Maximum)-5,
Chart1->Axes->Left->CalcYPosValue(0)-5));
}
if(WheelDelta < 0)
{
Chart1->ZoomRect(Rect(Chart1->Axes->Bottom->CalcXPosValue(0)-5,
Chart1->Axes->Left->CalcYPosValue(Chart1->Axes->Left->Maximum)-5,
Chart1->Axes->Bottom->CalcXPosValue(Chart1->Axes->Bottom->Maximum)+5,
Chart1->Axes->Left->CalcYPosValue(0)+5));
}
}
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 Narcís,
Thanks a lot for the prompt response. It worked just fine There is one more thing to be done: Is there a way to move the Graph around. As it is done in the example which i ment. For example clicking on it an moving it to the left side of the Window, so that when I do a zooming, I can zoom only the part which is seen on the screen.
Thanks again.
Stoyan
Thanks a lot for the prompt response. It worked just fine There is one more thing to be done: Is there a way to move the Graph around. As it is done in the example which i ment. For example clicking on it an moving it to the left side of the Window, so that when I do a zooming, I can zoom only the part which is seen on the screen.
Thanks again.
Stoyan
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi stoyan,
At this topic you'll find how to implement TTeeCommander's functionality at run-time. This is a TeeChart for .NET example but the same applies for the VCL version.
At this topic you'll find how to implement TTeeCommander's functionality at run-time. This is a TeeChart for .NET example but the same applies for the VCL version.
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 Stoyan,
I'm afraid the images you posted are not visible here. Could you please check it again? You should post them to some server (even it's a free imaging server) and past the URL with an image tag.
Thanks in advance.
I'm afraid the images you posted are not visible here. Could you please check it again? You should post them to some server (even it's a free imaging server) and past the URL with an image tag.
Thanks in advance.
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 Stoyan,
in order to zoom Polar Series correctly you would have to use similar code to the following :
in order to zoom Polar Series correctly you would have to use similar code to the following :
Code: Select all
uses teCanvas,Math;
{$R *.dfm}
procedure TForm1.Chart1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
oldY:=y;
mousedown := true;
end;
procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var tmp : Double;
tmp2 : Double;
begin
Chart1.View3D:=true;
if mousedown then
with Chart1.View3DOptions do
begin
tmp:=(10.0*(OldY-Y)/TeeDistance(Chart1.ChartWidth,Chart1.ChartHeight));
tmp2:=(10.0*tmp*ZoomFloat/100.0);
if tmp>0 then
ZoomFloat:=ZoomFloat+Math.Max(1,tmp2)
else
if tmp<0 then
ZoomFloat:=Math.Max(1,ZoomFloat+Math.Min(-1,tmp2));
end;
OldY:=Y;
end;
procedure TForm1.Chart1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
mousedown := false;
end;
Pep Jorge
http://support.steema.com
http://support.steema.com