Hi!
I have a TDBChart with a Lines series, and I would like to try different color palletes to find the best one (read, the one that repeats less colors) to be used with the situation when the datasource returns several records (meaning more than 15 lines in the chart).
I tried to use DBChart1.ColorPaletteIndex:=<<some existing index>> but seems to produce no effect at all.
Can someone point me to the correct way of doing this?
Carlos
Modifying lines colors in TDBChart
-
- Newbie
- Posts: 33
- Joined: Thu Mar 18, 2004 5:00 am
- Location: Brasil
- Contact:
Re: Modifying lines colors in TDBChart
Hola Carlos,
Take a look at the example at "All Features\Welcome !\Aspect\Custom Palettes" in the features demo included with the installation. It shows how to change between the different default palettes and how to create a customized one.
However, the default palettes (and any you can create) have a limited size. If you want to create more series than colors your palette has, you will probably want to reuse the colors in the palette. You could do so as in the following example:
Take a look at the example at "All Features\Welcome !\Aspect\Custom Palettes" in the features demo included with the installation. It shows how to change between the different default palettes and how to create a customized one.
However, the default palettes (and any you can create) have a limited size. If you want to create more series than colors your palette has, you will probably want to reuse the colors in the palette. You could do so as in the following example:
Code: Select all
uses Series;
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
Chart1.View3D:=false;
ColorPalettes.ApplyPalette(Chart1, WindowsVistaPalette);
for i:=0 to 20 do
with Chart1.AddSeries(TFastLineSeries) do
begin
FillSampleValues;
Color:=Chart1.ColorPalette[i mod Length(Chart1.ColorPalette)-1];
end;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |