Polar Series

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
dpatch
Newbie
Newbie
Posts: 19
Joined: Mon Mar 10, 2014 12:00 am

Polar Series

Post by dpatch » Thu Jul 17, 2014 12:52 pm

I am trying to create a chart that is sort of a cross between a polar plot and a color grid. Is this possible?

It would look like this...
PolarColorSeries.jpg
PolarColorSeries.jpg (151.22 KiB) Viewed 19676 times
It was created from a TColorGridSeries that Looks like this...
TColorGridSeries.jpg
TColorGridSeries.jpg (147.82 KiB) Viewed 19662 times

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Polar Series

Post by Narcís » Thu Jul 17, 2014 1:08 pm

Hi dpatch,

Sure! There's a specific series for that, the PolarGrid series? You can find an example at All Features\Welcome!\Chart Styles\Extended\Polar Grid.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

dpatch
Newbie
Newbie
Posts: 19
Joined: Mon Mar 10, 2014 12:00 am

Re: Polar Series

Post by dpatch » Thu Jul 17, 2014 4:42 pm

Thanks for the quick response!

I am looking at it now. Is there a way to leave the center empty/transparent (as shown above), or even display a BMP in it? I do not want the inside pixels so close together. Thanks.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Polar Series

Post by Narcís » Fri Jul 18, 2014 8:13 am

Hi dpatch,

Casually, this is the same we discussed here a couple of days ago. PolarGrid series also has DrawZone method. However, it's also affected by ID850. Please feel free to sign up at bugzilla and add yourself to the CC List to receive bug update notifications.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

jens.mertelmeyer
Newbie
Newbie
Posts: 60
Joined: Fri Nov 22, 2013 12:00 am

Re: Polar Series

Post by jens.mertelmeyer » Fri Jul 18, 2014 9:13 am

If you're using a PolarGridSeries, can't you just not fill the inner cells? That would certainly make some Kind of a "hole" in there.

Also, placing something like a Bitmap in the centre of the polar diagram sounds appealing. Currently, I would not know how to best place some VCL component like a TPanel or TImage there so that it won't overlap with the diagram and only "fills" the hole.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Polar Series

Post by Narcís » Fri Jul 18, 2014 9:26 am

Hello Jens,

Thanks for your contribution.
jens.mertelmeyer wrote:If you're using a PolarGridSeries, can't you just not fill the inner cells? That would certainly make some Kind of a "hole" in there.
Yes, you are right. You could set those cells to null not to be painted, for example:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var Sector, Track : Integer;
    tmp     : TChartValue;
    index   : Integer;
begin
  with Series1 do
  begin
    Clear;

    CircleLabels:=True;
    RadiusIncrement:=1;

    NumSectors:=15;
    NumTracks:=10;

    BeginUpdate;

    for Sector:=0 to NumSectors-1 do
        for Track:=0 to NumTracks-1 do
        begin
          tmp:=0.5*Sqr(Cos(Sector/(NumSectors*0.2)))+
                   Sqr(Cos(Track/(NumTracks*0.2)))-
                   Cos(Track/(NumTracks*0.5));

          index:=AddCell(Sector,Track,tmp);

          if Track < 5 then
            SetNull(index);
        end;

    EndUpdate;

    AngleIncrement:=360/NumSectors;
  end;
end;
jens.mertelmeyer wrote:Also, placing something like a Bitmap in the centre of the polar diagram sounds appealing. Currently, I would not know how to best place some VCL component like a TPanel or TImage there so that it won't overlap with the diagram and only "fills" the hole.
It might be easier drawing an image in the chart canvas using its Draw or StretchDraw methods. The most difficult part would be calculating the exact image size and location.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

dpatch
Newbie
Newbie
Posts: 19
Joined: Mon Mar 10, 2014 12:00 am

Re: Polar Series

Post by dpatch » Fri Jul 18, 2014 2:32 pm

I don't seem to be able to find the TPolarGridSeries to drop it on the form. I see it in the User Guide but can't find it in TCharts. Can you help? Thanks!

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Polar Series

Post by Narcís » Fri Jul 18, 2014 2:37 pm

Hi dpatch,

At design-time, using the chart editor (double-click on a TChart component) you can find it at Series > Add > 3D > Polar Grid, scrolling down if necessary. At run-time you can find it at the TeePolarGrid class.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

dpatch
Newbie
Newbie
Posts: 19
Joined: Mon Mar 10, 2014 12:00 am

Re: Polar Series

Post by dpatch » Fri Jul 18, 2014 7:12 pm

OK, I got this working. Is there a way to speed things up? Sort of like setting IrregularGrid in TColorGridSeries. Everything draws REALLY slow.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Polar Series

Post by Sandra » Tue Jul 22, 2014 9:38 am

Hello dpatch,

Sorry for the delay. I think can be useful for you take a look in real time article where you can see different techniques to increase speed of your Chart.

Hoping it will help otherwise, don't hesitate to let me know.
Thanks in advance,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

dpatch
Newbie
Newbie
Posts: 19
Joined: Mon Mar 10, 2014 12:00 am

Re: Polar Series

Post by dpatch » Mon Aug 04, 2014 11:22 pm

Sandra,

I truely appreciate you reply. I have read the documents regarding how to speed up the plotting and honestly they are of little help. These are the same documents that you have referenced for years. If you put a lot of data into this type of plot you will quickly see my point. I think you can easily generate an image like the one I posted and tell me if you understand my issue. If not, I can supply you with a sample that will make my point.

Thanks in advance,
dave

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

Re: Polar Series

Post by Yeray » Wed Aug 06, 2014 7:46 am

Hi Dave,

I've made a simple example and it seems to work fast for me here.

Code: Select all

uses TeePolarGrid;

procedure TForm1.FormCreate(Sender: TObject);
var index   : Integer;
begin
  Chart1.Align:=alClient;
  Chart1.View3D:=false;
  Chart1.Legend.Visible:=false;

  with Chart1.AddSeries(TPolarGridSeries) do
  begin
    FillSampleValues(24);
    for index:=0 to Count-1 do
      if YValue[index] < 10 then
        ValueColor[index]:=clBlack;
  end;
end;
I've also tried incrementing the number of values (ie FillSampleValues(24) ending in 10.000 cells) and it still looks fast for me here.
FillSampleValues(24);
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