Page 1 of 1

TColorGrid or TSurfaceSeries value range highlighter

Posted: Mon Apr 03, 2006 4:12 pm
by 9234539
I like the way of the surface nearest tool looks. I'd like to have a feature that the cell of value within centern range is highlighted(using different color) or framed.

Ex. when I am using a TColorGridSeries, I want to know which cells are between 0.5-0.6 visually.

Thanks.

Posted: Mon Apr 03, 2006 4:31 pm
by narcis
Hi Fang,

You can easily do that defining your customized palettes:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var
  x,z: Integer;
begin
  Series1.FillSampleValues(32);
  Series1.UsePalette:=true;
  Series1.UseColorRange:=false;
  Series1.ClearPalette();
  Series1.AddPalette(0,RGB(255,255,255));
  Series1.AddPalette(0.1,RGB(225,225,225));
  Series1.AddPalette(0.2,RGB(200,200,200));
  Series1.AddPalette(0.3,RGB(175,175,175));
  Series1.AddPalette(0.4,RGB(150,150,150));
  Series1.AddPalette(0.5,clRed);
  Series1.AddPalette(0.6,RGB(125,125,125));
  Series1.AddPalette(0.7,RGB(100,100,100));
  Series1.AddPalette(0.8,RGB(75,75,75));
  Series1.AddPalette(0.9,RGB(50,50,50));

  for x:=0 to 10 do
    for z:=0 to 10 do
      Series1.AddXYZ(x,random,z);
end;

Posted: Tue Apr 04, 2006 3:51 pm
by 9234539
good point, I probably just need to change the pallete color dynamically. Thanks NarcĂ­s.

Posted: Wed Oct 01, 2008 9:57 am
by 9237867
I have a question about the syntax:

"Series1.AddPalette(0.4 ,RGB(150,150,150)); "

Does the first parameter specify the Y value of the series? E.g.

Series1.AddPalette(Y, Color);

Also, would the above work for a TIsoSurfaceSeries? Are there any additional flags that need to be set?

Posted: Wed Oct 01, 2008 10:06 am
by narcis
Hi Monkey,
Does the first parameter specify the Y value of the series? E.g.
This is AddPalette's description in TeeChart help file:

function AddPalette(Const AValue: TChartValue; AColor: TColor): Integer; overload;

Unit
TeeSurfa

Description
This method adds a new color Palette entry to the end of Palette list. Add returns the position of the entry in the Palette list. The Color parameter will be used to fill polygons with Y values up to the Value parameter. Custom color palettes can be created using this method. The UsePalette property should be True to use the palette entries.

Also, would the above work for a TIsoSurfaceSeries? Are there any additional flags that need to be set?
Yes, I don't think any specific setting for TIsoSurfaceSeries should be used.

Hope this helps!

Posted: Wed Oct 01, 2008 2:47 pm
by 9237867
That helps a lot, thanks very much! :)