cusom colors for pie

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Nati
Newbie
Newbie
Posts: 37
Joined: Mon Jun 29, 2009 12:00 am

cusom colors for pie

Post by Nati » Thu Mar 22, 2012 4:32 pm

Hi

We have a pie that is based on a clientdataset
we want to give it our own colors but couldn't find a way to do that, it seems to have a fixed number of themes to be used but not a manual one
please advice
Thanks

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: cusom colors for pie

Post by Yeray » Fri Mar 23, 2012 3:43 pm

Hi Nati,

You can assign a color manually to the series' ValueColor array.
Alternatively, you could use ColorSource property to use the colors from the datasource as explained here
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

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

Re: cusom colors for pie

Post by Narcís » Fri Mar 23, 2012 3:49 pm

Hi Nati,

You can provide colors either using VCL TColor values, for example: clRed, clGreen, clWhite, etc.; or using RGB(r,g,b) method.
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

Nati
Newbie
Newbie
Posts: 37
Joined: Mon Jun 29, 2009 12:00 am

Re: cusom colors for pie

Post by Nati » Sun Mar 25, 2012 8:12 am

Hi

I have a set of several colors and I don't know how many colors I will need in pie so instead of looping and guessing, can't I just set a palette and let it use it automatically?

Nati
Newbie
Newbie
Posts: 37
Joined: Mon Jun 29, 2009 12:00 am

Re: cusom colors for pie

Post by Nati » Sun Mar 25, 2012 8:18 am

I'm doing the following, just to check:
for i := 0 to DBChart1.Series[0].ValuesList.Count - 1 do
DBChart1.Series[0].ValueColor := $00FE9B82;

and even though DBChart1.Series[0].ValuesList.Count returns 2
I get list index out of bounds(1) error for DBChart1.Series[0].ValueColor (when i equals 1)

If there is a way to set this palette in design time it will help a lot
Thanks

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

Re: cusom colors for pie

Post by Narcís » Mon Mar 26, 2012 7:31 am

Hi Nati,
I have a set of several colors and I don't know how many colors I will need in pie so instead of looping and guessing, can't I just set a palette and let it use it automatically?
Yes, you can create your own custom color palettes as explained in the All Features\Welcome!\Aspect\Custom palettes example at the new features demo available at TeeChart's program group.
I'm doing the following, just to check:
for i := 0 to DBChart1.Series[0].ValuesList.Count - 1 do
DBChart1.Series[0].ValueColor := $00FE9B82;

and even though DBChart1.Series[0].ValuesList.Count returns 2
I get list index out of bounds(1) error for DBChart1.Series[0].ValueColor (when i equals 1)


Series' ValueLists are the structure where series' values are stored so usually series have those ValueLists: XValues, YValues, ValueColor and LabelText. Some series have more ValueLists. Each ValueList store correpsonding values. For your purpose you should not loop according to ValueList.Count, this will give you the number of ValueLists, not the number of points in a series. You should loop ValueColor.Count or Series.Count instead.

If the problem persist please attach a simple example project we can run "as-is" to reproduce the problem here.

If there is a way to set this palette in design time it will help a lot


No, there's no design-time support for that.
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

Post Reply