TColorGrid or TSurfaceSeries value range highlighter

Ideas and wishes for TeeChart
Post Reply
Fang
Newbie
Newbie
Posts: 66
Joined: Wed Oct 13, 2004 4:00 am

TColorGrid or TSurfaceSeries value range highlighter

Post by Fang » Mon Apr 03, 2006 4:12 pm

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.

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

Post by Narcís » Mon Apr 03, 2006 4:31 pm

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;
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

Fang
Newbie
Newbie
Posts: 66
Joined: Wed Oct 13, 2004 4:00 am

Post by Fang » Tue Apr 04, 2006 3:51 pm

good point, I probably just need to change the pallete color dynamically. Thanks Narcís.

Monkey
Newbie
Newbie
Posts: 6
Joined: Wed Jul 27, 2005 4:00 am

Post by Monkey » Wed Oct 01, 2008 9:57 am

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?

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

Post by Narcís » Wed Oct 01, 2008 10:06 am

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!
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

Monkey
Newbie
Newbie
Posts: 6
Joined: Wed Jul 27, 2005 4:00 am

Post by Monkey » Wed Oct 01, 2008 2:47 pm

That helps a lot, thanks very much! :)

Post Reply