How to customize the piechart slice colors?

Stimulsoft Reports.NET discussion
abhi_svks
Posts: 20
Joined: Wed Apr 16, 2008 2:22 am
Location: Chennai

How to customize the piechart slice colors?

Post by abhi_svks »

Hi,
How to customize the piechart slice colors?
Without compiling or creating new dlls, is it possible?

I need the details as soon as possible.

Thanks in advance.

Regards

Kamaraj.P
ACSYS
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

How to customize the piechart slice colors?

Post by Andrew »

I the last version of 2008.2 you can create your own style for Charts in the Designer of Styles.

Thank you.
lucas
Posts: 7
Joined: Fri Oct 21, 2011 9:25 am
Location: Italy

How to customize the piechart slice colors?

Post by lucas »

Hello,
I used the Designer of Style for color slices pie.

Now I would like to associate the color slices with the colors that I decided on my db.
I explain with an example.
I have on my DB this association from category and color:

England -> Red
Russia -> Blue
USA -> Green
France -> Yellow
Italy -> White

And my style on the report contains the previos color in the same order: red, blue, green, yellow, white.

Now I pass to my report this dataset to draw the pie:

England = 25
USA = 55
Italy = 20

And the color of the slices pie are represent like:

England -> Red
USA -> Blue
Italy -> Green

But I would like this representation was:

England -> Red
USA -> Green
Italy -> White

Ultimately I would like maintain the same color I have decided on my DB.

Is it possible?

I remain available for further clarification, thanks in advanced,
Luca
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

How to customize the piechart slice colors?

Post by HighAley »

Hello.
lucas wrote:I used the Designer of Style for color slices pie.

Now I would like to associate the color slices with the colors that I decided on my db.
I explain with an example.
I have on my DB this association from category and color:

England -> Red
Russia -> Blue
USA -> Green
France -> Yellow
Italy -> White

And my style on the report contains the previos color in the same order: red, blue, green, yellow, white.

Now I pass to my report this dataset to draw the pie:

England = 25
USA = 55
Italy = 20

And the color of the slices pie are represent like:

England -> Red
USA -> Blue
Italy -> Green

But I would like this representation was:

England -> Red
USA -> Green
Italy -> White

Ultimately I would like maintain the same color I have decided on my DB.

Is it possible?

I remain available for further clarification, thanks in advanced
You can do it using Condition. Please, see the attached report template.

Thank you.
Attachments
1376.ChartColumns.mrt
(22.01 KiB) Downloaded 461 times
lucas
Posts: 7
Joined: Fri Oct 21, 2011 9:25 am
Location: Italy

How to customize the piechart slice colors?

Post by lucas »

Thanks you very much. I download the example and it was simple and clear; it works ok.

At last another question, is it possible set condition with data from my dataset?

I would like to set color condition from a color table on my DB (only the first time i load report or every time i load report it's the same).

Thank you in advanced.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

How to customize the piechart slice colors?

Post by Alex K. »

Hello,

Can you please send us sample report with test data for analysis.

Thank you.
lucas
Posts: 7
Joined: Fri Oct 21, 2011 9:25 am
Location: Italy

How to customize the piechart slice colors?

Post by lucas »

Hello,

the example in attachment was born from your data in Demo.xsd and in Demo.xml but I delete some Product element in Demo.xml to print a pie with few slices, for report I used a modify version of ChartPieAndDoughnut.mrt (you find it on attachment named ChartPieAndDoughnut_Lucas.mrt).

I add in the Demo.xsd the element "Color" with the subelement:
- ColorID: number of color I want to associate to a Category;
- CategoryID: number of category associated to ColorId;
- Description: field for description.

While in the Demo.xml I add four Color element: ColorID and CategoryID tags have value not real because, in my code, they arrive from my DB, and Description tag conteins the ProductName I would like have the same color.

Now, from your last post topic for specifying the color of slices pie I have to set condition in the Series editor. But when I set conditions I haven't any possibilities to choose color from colors specified in the element created previously (in other word I can't choose element to Color dataset in the DataSource Demo).

Is there a possibilities to use Color value to force color slices in the pie?

I remain available for further clarification, thanks in advanced,
Luca
Attachments
1403.ChartPieAndDoughnut_Lucas.mrt
(26.33 KiB) Downloaded 350 times
1401.Demo.xml
(1.5 MiB) Downloaded 737 times
1400.Demo.xsd
(9.29 KiB) Downloaded 413 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

How to customize the piechart slice colors?

Post by HighAley »

Hello.

Unfortunately, it is impossible now. We are working on this feature. We will let you know when the solution is available.

Thank you.
lucas
Posts: 7
Joined: Fri Oct 21, 2011 9:25 am
Location: Italy

How to customize the piechart slice colors?

Post by lucas »

Many thanks,
Luca
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

How to customize the piechart slice colors?

Post by Andrew »

Hello,

We are happy to help you.

Thank you.
Post Reply