Page 1 of 1

How to draw Polar Series using Custom Axes

Posted: Tue Dec 19, 2017 3:22 am
by 16582574
I do not find any examples of Polar Series based on the Custom Axes, and I want to know how the Radius Axis and Angle Axis work. Could you help me, please?

Re: How to draw Polar Series using Custom Axes

Posted: Wed Dec 20, 2017 10:53 am
by yeray
Hello,

The Circled don't support Custom axes.
The Vertical Axis is used to draw the Circular Grid Rings, and the Horizontal Axis is used to draw the Angle lines, Ticks, MinorTicks and Labels.

Re: How to draw Polar Series using Custom Axes

Posted: Wed Dec 20, 2017 1:54 pm
by 16582574
When the Polar Series are drawn using the Custom Axes, How to draw the cross axes from the center of circle area? Just like the default TChart using the LeftAxis, RightAxis, TopAxis and BottomAxis. Thanks!

Re: How to draw Polar Series using Custom Axes

Posted: Wed Dec 20, 2017 2:04 pm
by 16582574
Alternatively,is there an appropriate method to draw radius Labels?

Re: How to draw Polar Series using Custom Axes

Posted: Wed Dec 20, 2017 2:58 pm
by yeray
Hello,

I'm not sure to understand you. Could you please arrange a simple example project showing what are you exactly doing and some screenshot showing what are you trying to achieve?
Thanks in advance.

Re: How to draw Polar Series using Custom Axes

Posted: Wed Dec 20, 2017 11:33 pm
by 16582574
1. A PolarSeries Chart is drawn without radial labels (Fig.1). How to draw the titles and labels of LeftAxis, RightAxis, TopAxis and BottomAxis (Fig.2)?
2. Two PolarSeries Charts are drawn in pairs with one TeeCommander (Fig.3), and I can control one of the two Charts alternately by setting the TeeCommander.Panel. Is it possible to synchronously control both of them with one TeeCommander? I want to take the two Charts as one Chart, and zoom, copy, save them together.
Thanks.

Re: How to draw Polar Series using Custom Axes

Posted: Wed Dec 27, 2017 4:15 pm
by Marc
Hello,

Re 1.
The Axis Labels ... Titles, may be shown by adding the text in this way:

Code: Select all

Chart1.Axes.Left.Title.Text := 'my left axis';
The same for Top, Right and Bottom.

Re 2.
A TeeCommander can only control one Chart at a time. It can be changed at runtime by setting the teeCommander.Panel property. To copy zoom settings across charts it may be easiest to do that via the OnAfterDraw eventy of the Chart that the Commander is related to. You can use the Axes' SetMinMax method to copy new Axis Min and Max to the second Chart and can make other modifications in the same way.

To copy and save there are other techniques available, you can 'draw' charts to locations on a common canvas if you wish to drive two charts separately. Alternatively add subcharts to the first chart and the Chart Canvas will control the main chart and subcharts simultaneously for save & copy.

See the Chart Tools, SubChart tool examples in the TeeChart example demo for a visual demonstration.

Regards,
Marc Meumann

Re: How to draw Polar Series using Custom Axes

Posted: Thu Dec 28, 2017 3:26 am
by 16582574
Thank you for your advice. I use the TSubChartTool, and it works. However, the first chart always locates at the center of the Panel, although I try to set its Width, ChartRect.SetLocation and (ChartRect.Left, ChartRect.Right).
I hope that the two charts would be horizontally arranged, do not overlap, and have the same sizes. Could you please help me?
Best Regards.

Re: How to draw Polar Series using Custom Axes

Posted: Fri Dec 29, 2017 11:46 am
by Marc
Hello,

You can set the ChartRect before rendering the Series. For example, using this event for the first Chart Series would move it over to the left half:

Code: Select all

procedure TForm1.Series1BeforeDrawValues(Sender: TObject);
begin
   TheChart.ChartRect:=Rect( 30, 30, 470, 470);
end;
The ChartRect has left space for labels (30 pixels each side) within the 500x500 half chart area.

The second series could be set in a subchart as you have done and positioned as discussed here: http://www.teechart.net/support/viewtop ... =3&t=16773. For my test project I added the second Polar Series to the main chart at designtime to make it easier to setup the BeforeDrawValues at designtime, then assigned the Series to the SubChart.

Designtime image with two series in chart plus subchart:
polardesigntime.png
polardesigntime.png (78.31 KiB) Viewed 26583 times
At runtime it looks like this:
polarruntime.png
polarruntime.png (254.2 KiB) Viewed 26584 times
I attach the modified project.

Regards,
Marc

Re: How to draw Polar Series using Custom Axes

Posted: Mon Jan 01, 2018 7:30 am
by 16582574
Yes, Your modified project works fine. However, how to use the BeforeDrawValues procedure to set the ChartRect’s properties, if the PolarSeries are dynamically created?

Re: How to draw Polar Series using Custom Axes

Posted: Tue Jan 02, 2018 12:28 pm
by Marc
Hello,

You can assign the dynamic series' event dynamically to the existing event method if you've already created it for an existing series and it's generic (ie. how it acts upon 'sender') or to a new method of your own (with the same parameters).

eg.

Code: Select all

procedure TForm2.Button3Click(Sender: TObject);
begin
  mySeries.BeforeDrawValues := Series1BeforeDrawValues;
end;

procedure TForm2.Series1BeforeDrawValues(Sender: TObject);
begin
 //my code .. do something with Sender
end;
Regards,
Marc

Re: How to draw Polar Series using Custom Axes

Posted: Thu Jan 04, 2018 12:49 pm
by 16582574
There are two Charts (Original Chart and TSubChartTool.Charts[0].Chart) and a TeeCommander. The TeeCommander always handles with the Original Chart. In order to move and zoom the two Charts, respectively, how to make the TeeCommander to alternately control one of the two Charts?

Re: How to draw Polar Series using Custom Axes

Posted: Mon Jan 08, 2018 8:34 am
by Marc
Hello,

As noted here ,http://www.teechart.net/support/viewtop ... 764#p74584, You need to direct the TeeCommander to the Chart you require to modify at the moment you wish to do so.

ie.

Code: Select all

TeeCommander1.Panel := ChartTool1.Charts[0].Chart;
You can then switch it back to the first Chart by resetting the Panel property. Alternatively, use two TeeCommanders.

Regards,
Marc