Focal Point Banner

As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at for further assistance. Reference the community FAQ to learn more about the community.

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Pie Chart Slice Color

Read-Only Read-Only Topic
Pie Chart Slice Color
Platinum Member
Hi all
i have Some Doubts in my Pie my Requirement is i want to do each slice having differenet color. i want to put my custom colors on each slice. i want API for this.

Posts: 155 | Location: Bangalore. | Registered: January 24, 2006Report This Post
Platinum Member
posted Hide Post
You would put the following commands within your graphstyle I believe:

setFillColor(getSeries(0),new Color(0,0,255)); blue
setFillColor(getSeries(1),new Color(0 255 0)); lime green
setFillColor(getSeries(2),new Color(255,0,255)); fuscia
setFillColor(getSeries(3),new Color(255,255,0)); yellow
setFillColor(getSeries(4),new Color(0,255,255)); aqua
setFillColor(getSeries(5),new Color(50,153,204)); sky blue
setFillColor(getSeries(6),new Color(255,0,0)); red

To determine colors, Susannah has created a document that is called Excel Colorname Key – What Is "Indian Red," Anyway (works for graphs). You can find this as you go into focal point in the developer center in the focus on developers section. Hope this helps.

webfocus 8.105M; os: windows; pdf, html, exl2k, csv
Posts: 179 | Registered: November 10, 2004Report This Post
Silver Member
posted Hide Post
To keep our colors consistent we put the setFillColor lines (about 20 of them) into a file on the WF Client server and put an include statement in our pie charts.


That also has the advantage of being able to change the colors for all the reports in one place if at some point the users decide they think your shade of yellow is just too bright.
Posts: 41 | Registered: January 06, 2006Report This Post
posted Hide Post
What do you do to prevent having 2 slices that are the same color next to each other. If you have 8 slices of pie there will be 2 the same color. Is there a way to prevent this.

This message has been edited. Last edited by: isjhb,
Posts: 21 | Registered: April 20, 2004Report This Post
Platinum Member
posted Hide Post
I second the suggestions from Pam & EJL.

We have the following piece of graph color stylesheet commands in a member by itself and
-INCLUDE this member in the stylesheet area of the fex, whenever we generate graphs (Bar or Pie).

-*-* other local S-S commands

setFillColor(getSeries(0), new Color(0,0,255));
setFillColor(getSeries(1), new Color(0,255,0));
setFillColor(getSeries(2), new Color(255,0,255));
setFillColor(getSeries(3), new Color(255,255,0));
setFillColor(getSeries(4), new Color(255,0,0));
setFillColor(getSeries(5), new Color(255,165,0));
setFillColor(getSeries(6), new Color(255,192,203));
setFillColor(getSeries(7), new Color(0,255,255));
setFillColor(getSeries(8), new Color(206,0,54));
setFillColor(getSeries(9), new Color(255,239,0));
setFillColor(getSeries(10), new Color(0,152,82));

You could play around with the color palette and come up with your own RGB values. This example gives you 11 custom colors. If you need more, you just keep repeating the lines with an ascending getSeries(xx) value and new RGBs.
Hope that helps !!

This message has been edited. Last edited by: BlueZone,

Blue Cross & Blue Shield of MS
WF.76-10 on (WS2003 + WebSphere) / EDA on z/OS + DB2 + MS-SQL
MRE, BID, Dev. Studio, Self-Service apps & a dash of fun !! Music
Posts: 218 | Location: Jackson, MS | Registered: October 31, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Pie Chart Slice Color

Copyright © 1996-2020 Information Builders