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 community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
Here is an GGSALES example of a stacked bar graph, single sum field stacked by Category. How can I assign the series with the highest summed number to a specific color in the graph?
GRAPH FILE GGSALES
SUM
BUDDOLLARS
BY CATEGORY
ACROSS DATE AS ' '
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 2
ON GRAPH SET LOOKGRAPH VBRSTK1
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);
*END
ENDSTYLE
END
This message has been edited. Last edited by: Don Garland,
Originally posted by Tomsweb: First, run the code to view the chart. Then, right click on that data point and select change color. You can also change from series to group and that will give each data point it's own color.
Instead of summing BUDDOLLARS by CATEGORY, consider DEFINEing each CATEGORY individually, then summing them in whatever order you want the as follows:
DEFINE FILE GGSALES
Gifts_DOL/D20M = IF CATEGORY EQ 'Gifts' THEN BUDDOLLARS ELSE 0;
Food_DOL/D20M = IF CATEGORY EQ 'Food' THEN BUDDOLLARS ELSE 0;
Coffee_DOL/D20M = IF CATEGORY EQ 'Coffee' THEN BUDDOLLARS ELSE 0;
END
GRAPH FILE GGSALES
SUM Coffee_DOL
Gifts_DOL
Food_DOL
. . .
I'm sure that's work for you.
You can add "setFillColor(getSeries(0),new Color(0,255,0));" to change the series colors.
Just in case you want to programatically figure out the stack order, you can predetermine the order as a pre-process to see which category has the highest values and SUM them in that order. However, beware of doing that as the users may get used to seeing 'Coffee' in the bottom section, then when 'Gifts' out sell coffee it switches and that becomes confusing to the users.
Yes, that did work. I asked the question badly though, It really wasn't the colors, it was arranging them in a certain order. Your example reminded me that I needed to make my own categories so that I could put them in the sequence I wanted to.
Now all I have to do is determine the 1st highest, 2nd highest and 3rd highest. I'll do that with a HOLD file before the chart and use variable in the GRAPH.