Polar Series

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Bill
Newbie
Newbie
Posts: 13
Joined: Wed Apr 11, 2012 12:00 am

Polar Series

Post by Bill » Thu Apr 12, 2012 3:11 pm

Hi,

I have to admit that I'm totally confused as to how this PolarSeries works now. I drop a TPolarSeries in to a Chart. and add the following code.


__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
Series1->GetVertAxis->Automatic = 1;
Series1->GetHorizAxis->Automatic = 1;
Series1->Circled = 1;
for(int i = 0; i < 360; i+=5)
Series1->AddPolar(i, 10, "", clRed);
}

I should see a circle of radius 10. But what I see is a dot. When I start panning, I see a ellipse with label 10 changing shape, and label 10s on top and bottom axis moving.

How do I set the minimum, maximum, labels on Radius circle as well as label on angles? What does panning mean anyway in a polar chart? How do I zoom in and out?


Thanks

-Bill

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

Re: Polar Series

Post by Yeray » Mon Apr 16, 2012 10:21 am

Hi Bill,

Note the axes, when automatic, are scaled to fit the series values. In your example, where all the values are equal, the axes show an special behaviour, with both minimum and maximum to 10.
Try setting the axes minimum and maximum manually:

Code: Select all

  Series1->GetVertAxis->SetMinMax(0,20);
  Series1->GetHorizAxis->SetMinMax(0,20);
Bill wrote:How do I set the minimum, maximum, labels on Radius circle as well as label on angles? What does panning mean anyway in a polar chart? How do I zoom in and out?
Both panning and zooming work as with the other series. They just change the axes scale (minimum and maximum). However, since this series axes are a little bit particular, these features may feel strange.
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

Bill
Newbie
Newbie
Posts: 13
Joined: Wed Apr 11, 2012 12:00 am

Re: Polar Series

Post by Bill » Tue Apr 17, 2012 1:32 pm

Series1->GetHorizAxis->SetMinMax(0,20);

GetHorizAxis returns Angle axis. This means sets the Angle axis to display 0 to 20 degree?

Shouldn't the action of panning be moving the whole chart along with mouse? What I see is that the circle is being re-scaled. The same goes with zooming. When I zoom in to a series, the series disappears!

would you please provide an example where it shows that zooming zooms in to a series and panning does move the series.

I must have some parameters set incorrectly because I just can not get the zooming and panning working properly.

Thanks

-Bill

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

Re: Polar Series

Post by Yeray » Thu Apr 19, 2012 8:19 am

Hi Bill,
Bill wrote:GetHorizAxis returns Angle axis. This means sets the Angle axis to display 0 to 20 degree?
Where did you read "GetHorizAxis returns Angle axis"? The Polar series is drawn as a circle/ellipse using the Polar coordinate system.
Bill wrote:Shouldn't the action of panning be moving the whole chart along with mouse? What I see is that the circle is being re-scaled. The same goes with zooming. When I zoom in to a series, the series disappears!

would you please provide an example where it shows that zooming zooms in to a series and panning does move the series.

I must have some parameters set incorrectly because I just can not get the zooming and panning working properly.
I think you are looking for the move and zoom functionalities the commander offers, not the axes zoom and scroll. Could you please give it a try?
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

Bill
Newbie
Newbie
Posts: 13
Joined: Wed Apr 11, 2012 12:00 am

Re: Polar Series

Post by Bill » Thu Apr 19, 2012 1:41 pm

Where did you read "GetHorizAxis returns Angle axis"?

TeePolar.pas Line 1110.

{ The BottomAxis is used in Angle axis }
Function TCustomPolarSeries.GetAngleIncrement:Double;
.
.
.

result:=GetHorizAxis.Increment;

Bill
Newbie
Newbie
Posts: 13
Joined: Wed Apr 11, 2012 12:00 am

Re: Polar Series

Post by Bill » Thu Apr 19, 2012 2:24 pm

I guess my confusion comes from the fact that when you set/get AngleIncrement, GetHorizAxis is used. I'd assume that GetHorizAxis is associated with Angle Axis. And Yet, to set Radius scale, both

Series1->GetHorizAxis->SetMinMax(min, Max);
Series1->GetVertAxis->SetMinMax(min, Max);

have to be used (which I didn't realize before and that caused some confusion as well), which is strange to me because, as your link indicated, a polar coordinate system is defined by Radius and Angle, so when I set Radius MinMax, I should only need to set the values of one Axis.

The second issue is regarding Zoom/Panning. Yes, commander can be used to zoom/Panning of a TPolarSeries, but it only works when the Chart is in 3D! That would've been fine if the 3D% View could be set to 0%, which is not possible, and the effect of the 3D% View not being 0% is that if two identical PolarSeries are plotted, the graph shows a slight offset of the two series from each other, and that is very annoying! My point is that there is no way to Zoom/Panning of a 2D Polar series.

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

Re: Polar Series

Post by Yeray » Fri Apr 20, 2012 2:35 pm

Hi Bill,
Bill wrote:
Yeray wrote:Where did you read "GetHorizAxis returns Angle axis"?
TeePolar.pas Line 1110.

{ The BottomAxis is used in Angle axis }
Function TCustomPolarSeries.GetAngleIncrement:Double;
.
.
.

result:=GetHorizAxis.Increment;
Right. Note the circular series are quite particular. The Polar series (and radar, etc) uses the Bottom axis (GetHorizAxis) to store some properties (like the Increment, Grid) used to draw the "angle grid lines", the lines that start in the center of the circle. And it uses the Left axis (GetVertAxis) to store some properties used to draw the "concentric grid lines".
Bill wrote:I guess my confusion comes from the fact that when you set/get AngleIncrement, GetHorizAxis is used. I'd assume that GetHorizAxis is associated with Angle Axis. And Yet, to set Radius scale, both

Series1->GetHorizAxis->SetMinMax(min, Max);
Series1->GetVertAxis->SetMinMax(min, Max);

have to be used (which I didn't realize before and that caused some confusion as well), which is strange to me because, as your link indicated, a polar coordinate system is defined by Radius and Angle, so when I set Radius MinMax, I should only need to set the values of one Axis.
As mentioned above, some properties are taken from the Bottom/Left axes to draw the grids. But some other properties from the same axes are taken to draw the + cross in the center, where the labels are actually drawn.
Bill wrote:The second issue is regarding Zoom/Panning. Yes, commander can be used to zoom/Panning of a TPolarSeries, but it only works when the Chart is in 3D! That would've been fine if the 3D% View could be set to 0%, which is not possible, and the effect of the 3D% View not being 0% is that if two identical PolarSeries are plotted, the graph shows a slight offset of the two series from each other, and that is very annoying! My point is that there is no way to Zoom/Panning of a 2D Polar series.
If I use the following code to have two identical TPolarSeries, I can Zoom and Move through the commander and it seems to work fine. Doesn't it for you?

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D:=true;
  Chart1.Chart3DPercent:=1;

  Chart1.AddSeries(TPolarSeries).FillSampleValues;
  Chart1.AddSeries(TPolarSeries).DataSource:=Chart1[0];
end;
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

Bill
Newbie
Newbie
Posts: 13
Joined: Wed Apr 11, 2012 12:00 am

Re: Polar Series

Post by Bill » Tue Apr 24, 2012 1:26 pm

Not knowing Delphi, I assume Chart1.AddSeries(TPolarSeries).DataSource:=Chart1[0] is equivalent
Chart1->AddSeries(New TPolarSeries(Chart1))->DataSource = Chart1->Series[0];

This gives the same 1% offset in my test case. I assume with Chart1.Chart3DPercent:=1; All series will show an 1% offset from each other because each plot is 1% off from the previous one, so the issue still remains.

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

Re: Polar Series

Post by Yeray » Fri Apr 27, 2012 7:57 am

Hi Bill,

Excuse me, I'm afraid I forgot a pair of settings:

Code: Select all

uses TeePolar;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D:=true;
  Chart1.Chart3DPercent:=1;
  Chart1.Aspect.Orthogonal:=false;
  Chart1.Aspect.Elevation:=360;
  Chart1.Aspect.Rotation:=360;

  Chart1.AddSeries(TPolarSeries).FillSampleValues;
  Chart1.AddSeries(TPolarSeries).DataSource:=Chart1[0];
end;
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