TeeChart - Dynamic (Custom) Colors for PieChart

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Posts: 1
Joined: Mon Apr 12, 2021 12:00 am

TeeChart - Dynamic (Custom) Colors for PieChart

Post by Marinus » Thu Apr 07, 2022 6:43 am


I have a piechart linked to a dataset. (Dynamic) I need to change the colors of the PieChart at runtime within the Report itself based on a specific set of colors for the report (which is dependent on the specifc organization - each organization wants to define their specific colors). None of the standard colors is acceptable to my client.

For instance the colors colors are blue/orange (Only two values) but I need to make each slice (Value) of the Pie Chart a very specific color - it might or might not have to relate to the specific value in that slice.

Site Admin
Site Admin
Posts: 1086
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona

Re: TeeChart - Dynamic (Custom) Colors for PieChart

Post by Marc » Fri Apr 08, 2022 2:45 pm


You can set the colour as you add the data, using an rgb colour that matches the colour you require.


Code: Select all

or change the colour after adding the data.

Series1.ValueColor[1] := rgb(108,107,245);

alternatively, if you're working with a datasource, you can set the colour source for the Series from a field containg the colour definition.

Series1.ColorSource := dbColorField;
Marc Meumann
Steema Support

Post Reply