How do I change the legend range/level for TColorGridSeries
How do I change the legend range/level for TColorGridSeries
For TColorGridSeries, how do I set the range of legend (Y value) manually, ex from 0 to 1 and show 5 levels in between, like the contour plot levels.
thanks.
thanks.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Code: Select all
Series1->FillSampleValues(32);
Series1->UsePalette =true;
Series1->UseColorRange = false;
Series1->ClearPalette();
Series1->AddPalette(0,clYellow);
Series1->AddPalette(0.5,clGreen);
Series1->AddPalette(1,clRed);
But then I tried to set UseColorRange to true, it seems working but using colorrange color not the palette color. Am I doing right? Thanks.
Basically I want a long legend bar (continous color, which can be set) with only a few number besides it, like this.
|| 1.0
||
||
||
|| 0.5
||
||
||
|| 0.0
Most of the color annotated graph has a legend like that instead of like
|| 1.1034
|| 0.9453
|| 0.8545
|| 0.7434
|| 0.6434
|| 0.5344
|| 0.4343
|| 0.3323
|| 0.2344
Badly needed. Thanks.
|| 1.0
||
||
||
|| 0.5
||
||
||
|| 0.0
Most of the color annotated graph has a legend like that instead of like
|| 1.1034
|| 0.9453
|| 0.8545
|| 0.7434
|| 0.6434
|| 0.5344
|| 0.4343
|| 0.3323
|| 0.2344
Badly needed. Thanks.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Fang,
To achieve that you can use OnGetLegendText and set to an empty string the values you don't want to be displayed and modify the ones you want.
To achieve that you can use OnGetLegendText and set to an empty string the values you don't want to be displayed and modify the ones you want.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Fang,
You can also have that legend customly drawing on TeeChart's canvas.
You can also have that legend customly drawing on TeeChart's canvas.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Code: Select all
Series1->UseColorRange = true;
Series1->ClearPalette();
for (size_t i=0; i <= 40; i++)
Series1->AddPalette(0.025*i,clTeeColor);
void __fastcall TForm1::Chart1GetLegendText(TCustomAxisPanel *Sender,
TLegendStyle LegendStyle, int Index, AnsiString &LegendText)
{
int m=Index-(Index/4)*4;
if (m!=0) LegendText="";
}
Hi Fang,
You can get a continuous legend doing one of these things:
- Setting chart->Legend->VertSpacing less than 0 (I have set -10)
- or setting chart->Legend->Symbol->Continuous = true; (Legend Symbols tab)
And for the legend texts, you should use a coefficient dependant on the
number of palleteSteps (series->PalleteSteps)
Beetle.
You can get a continuous legend doing one of these things:
- Setting chart->Legend->VertSpacing less than 0 (I have set -10)
- or setting chart->Legend->Symbol->Continuous = true; (Legend Symbols tab)
And for the legend texts, you should use a coefficient dependant on the
number of palleteSteps (series->PalleteSteps)
Beetle.