Page 1 of 1
Polar Grid
Posted: Mon Oct 17, 2011 3:59 pm
by 16458675
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
Re: Polar Grid
Posted: Tue Oct 18, 2011 1:57 pm
by yeray
Hello Dieter,
Try setting
Code: Select all
Series1->UsePalette = true;
Series1->UseColorRange = false;
as described
here
Re: Polar Grid
Posted: Wed Oct 19, 2011 9:38 am
by 16458675
Hi Yeray,
thank you, it works. But what I still miss is the statement to set Colors -> Invers!
Dieter
Re: Polar Grid
Posted: Wed Oct 19, 2011 11:47 am
by yeray
Hi Dieter,
It's like this:
Re: Polar Grid
Posted: Wed Oct 19, 2011 1:45 pm
by 16458675
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
Re: Polar Grid
Posted: Wed Oct 19, 2011 2:22 pm
by yeray
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.
Re: Polar Grid
Posted: Tue Oct 25, 2011 8:12 am
by 16458675
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
Re: Polar Grid
Posted: Tue Oct 25, 2011 3:05 pm
by yeray
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.
Re: Polar Grid
Posted: Thu Oct 27, 2011 1:32 pm
by 16458675
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
Re: Polar Grid
Posted: Fri Oct 28, 2011 8:37 am
by yeray
Hello Dieter,
I'm glad to hear that. And thanks for sharing!