Polar Grid

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
DieterMuc
Newbie
Newbie
Posts: 6
Joined: Wed Mar 02, 2011 12:00 am

Polar Grid

Post by DieterMuc » Mon Oct 17, 2011 3:59 pm

Hi,
I work with C++Builder DS2007, Windows 7 and the latest TChart Version V2010.00.00407 Win32.
TChart-Series is: 3D -> Polar Grid -> Normal
During design-time I set the series1 to:Format -> Palette: Colors -> Rainbow and Invert, the steps to 22
During Runtime the series1 comes up with Format -> Palette -> Range what I do not need!
Only with the chart editor it is possible to set my parameters.

The following program-commands I found:
Series1 -> Palette -> PaletteStyle = psRainbow;
Series1 -> Palette -> PaletteSteps = 22;

But the result is none!

is there a way to set the desired parameter during runtime?

Thanks for an answer!

Regards

Dieter

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

Re: Polar Grid

Post by Yeray » Tue Oct 18, 2011 1:57 pm

Hello Dieter,

Try setting

Code: Select all

  Series1->UsePalette = true;
  Series1->UseColorRange = false;
as described here
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

DieterMuc
Newbie
Newbie
Posts: 6
Joined: Wed Mar 02, 2011 12:00 am

Re: Polar Grid

Post by DieterMuc » Wed Oct 19, 2011 9:38 am

Hi Yeray,

thank you, it works. But what I still miss is the statement to set Colors -> Invers!

Dieter

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

Re: Polar Grid

Post by Yeray » Wed Oct 19, 2011 11:47 am

Hi Dieter,

It's like this:

Code: Select all

Series1->InvertPalette();
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

DieterMuc
Newbie
Newbie
Posts: 6
Joined: Wed Mar 02, 2011 12:00 am

Re: Polar Grid

Post by DieterMuc » Wed Oct 19, 2011 1:45 pm

Hi Yeray,

here my code in C++ and it works:

Series1->Palette -> UsePalette = true;
Series1->Palette -> UseColorRange = false;

I Could not find a function: Series1 -> InvertPalette() or Series1 -> Palette -> InvertPalette() .

By the way: in Pascal-Examples I found the function.

Kind regards

Dieter

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

Re: Polar Grid

Post by Yeray » Wed Oct 19, 2011 2:22 pm

Hello Dieter,

I've just installed TeeChart v2010.00 in my RAD Studio 2007 and the InvertPalette function is recognized without problems as described above (Series1->InvertPalette(), being Series1 a TSurfaceSeries).
Please, check the library and include paths in your IDE (without any project opened) and try it again with a new simple application.
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

DieterMuc
Newbie
Newbie
Posts: 6
Joined: Wed Mar 02, 2011 12:00 am

Re: Polar Grid

Post by DieterMuc » Tue Oct 25, 2011 8:12 am

Hi Yeray,

in TSurfaceSeries I found the function InvertPalette(), but I do not use this series. I must use TPolarGridSeries. And there is not function InvertPalette() available. I'm sorry. Try it by yourself!

Kind regards

Dieter

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

Re: Polar Grid

Post by Yeray » Tue Oct 25, 2011 3:05 pm

Hello Dieter,

In Delphi you can do as follows:

Code: Select all

uses TeePolarGrid, TeeSurfa;

var polarGrid1: TPolarGridSeries;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D:=false;
  Chart1.Legend.Visible:=false;

  polarGrid1:=Chart1.AddSeries(TPolarGridSeries) as TPolarGridSeries;
  with polarGrid1 do
  begin
    FillSampleValues();
    Palette.UsePalette:=true;
    Palette.UseColorRange:=false;
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
var t   : Integer;
    tmp : TColor;
begin
  with polarGrid1.Palette do
  begin
    for t:=0 to (Length(Palette) div 2)-1 do
    begin
      tmp:=Palette[t].Color;
      Palette[t].Color:=Palette[Length(Palette)-t-1].Color;
      Palette[Length(Palette)-t-1].Color:=tmp;
    end;

    PaletteStyle:=psCustom;
  end;

  Chart1[0].Repaint;
end;
If you find problems translating it to C++Builder, don't hesitate to let us know.
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

DieterMuc
Newbie
Newbie
Posts: 6
Joined: Wed Mar 02, 2011 12:00 am

Re: Polar Grid

Post by DieterMuc » Thu Oct 27, 2011 1:32 pm

Hi Yeray,

Now it works perfectly. If anybody is interestet in the C++ Code here it is:

Code: Select all

void __fastcall TfmMainKennfeld::bbInversClick(TObject *Sender)
{
	TColor tmpColor;
	int iLength = polarGridSeries -> Palette -> PaletteSteps;

	for( int i = 0, j = iLength - 1; i < (iLength/2); ++i, --j )
	{
		tmpColor = polarGridSeries -> Palette -> Palette[i].Color;
		polarGridSeries -> Palette -> Palette[i].Color = polarGridSeries -> Palette -> Palette[j].Color;
		polarGridSeries -> Palette -> Palette[j].Color = tmpColor;
	}
	polarGridSeries -> Palette -> PaletteStyle = psCustom;
	Chart -> Repaint();
}
Thank you!

Kind regards

Dieter

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

Re: Polar Grid

Post by Yeray » Fri Oct 28, 2011 8:37 am

Hello Dieter,

I'm glad to hear that. And thanks for sharing! :D
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