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 community@tibco.com 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     [CLOSED] Dynamically Switching Series Color

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Dynamically Switching Series Color
 Login/Join
 
Member
posted
Hello,

I am working on a bar chart that is doing a count of people for the x-axis, broken out by month on the y-axis and is colored by groups.

Example is for the month of January development team had 4 people colored blue, management team had 2 people colored red, and support team had 3 people colored green.

I am using a custom style sheet to set the series value to be each of these colors using the "series": X, "color": "#999999".

I want to keep this same color scheme but have the colors flipped. This works great for our department because I could just manually flip the colors around to get the new color scheme but if another one of our departments were to use this report that had 4 groups (development, management, support, and implementations) then the color scheme is thrown off because blue wouldn't be the last one in the series.

Example for our department the month of January development team had 4 people colored green, management team had 2 people colored red, and support team had 3 people colored blue.

Example for our other department the month of January development team had 4 people colored green, management team had 2 people colored red, and support team had 3 people colored blue, implementations team had 1 person colored orange.

Is there a way I could keep the same series color scheme but tell it to color the series in the reverse order? Essentially "series": 0, "color": "#0000FF" would be the last color to be used for the series while "series": X, "color": "#999999" would be the first value depending on the number of groups.

Thank you for any advice.

-Alex

This message has been edited. Last edited by: FP Mod Chuck,
 
Posts: 10 | Registered: June 19, 2018Report This Post
Virtuoso
posted Hide Post
Alex
Could you do a mock up using one of the basic files, CAR or GGSALES?


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Member
posted Hide Post
Here is some sample code from the GGSALES file

ENGINE INT CACHE SET ON
SET PAGE-NUM=NOLEAD
-DEFAULTH &WF_HTMLENCODE=OFF;
SET HTMLENCODE=&WF_HTMLENCODE

SET ARGRAPHENGINE=JSCHART
-DEFAULTH &WF_EMPTYREPORT=ON;
SET EMPTYREPORT=&WF_EMPTYREPORT

SET EMBEDHEADING=ON
SET GRAPHDEFAULT=OFF
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';

-DEFAULTH &WF_TITLE='WebFOCUS Report';
GRAPH FILE GGSALES
-* Created by Info Assist for Graph
SUM CNT.GGSALES.SALES01.PCD
BY GGSALES.SALES01.CATEGORY
BY GGSALES.SALES01.DATE
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET LOOKGRAPH BAR
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT

setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);

*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/combine_templates/Mosaic.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $
TYPE=DATA, COLUMN=N1, BUCKET=color, $
TYPE=DATA, COLUMN=N2, BUCKET=x-axis, $
TYPE=DATA, COLUMN=N3, BUCKET=y-axis, $
*GRAPH_SCRIPT

setReportParsingErrors(false);
setSelectionEnableMove(false);

*END
ENDSTYLE
END

-RUN

For this example on our data for the first date there are 3 categories (coffee, food, gifts) thus there are three bars with the coffee bar having a product count of 1440 and a color of blue, the food bar having a product count of 1440 and a color of orange and the gifts bar having a product count of 1437 and a color of green.

There is an INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/combine_templates/Mosaic.sty
line which is my custom style sheet in which I set the series color order to be blue, orange, green, red, etc.

"series": [
{
"series": "all",
"dataLabels": {
"visible": "auto",
"font": "7.5pt Sans-Serif",
"color": "auto"
},
"color": null,
"border": {
"width": 3
},
"marker": {
"visible": false,
"size": 10,
"border": {
"width": 2
},
"shape": "circle",
"fillEffect": "seriesFill"
}
},
{ /* Blue */
"series": 0,
"color": "#0072B2"
},
{ /* Orange */
"series": 1,
"color": "#FF6800"
},
{ /* Green */
"series": 2,
"color": "#228B22"
},
{ /* Red */
"series": 3,
"color": "#CC2529"
},

For the above example I know I could manually switch this series order around to be green, orange, blue and the colors are switched, however, the problem is what if for me I only have those 3 categories but what if for another person on my team they had a 4th category that was toys.

With this 4th category then the color scheme ends up being green, orange, blue, red but I want the color scheme to be red, green, orange, blue. While I could set the series order then to be red, green, orange, blue when I would run it since I only have 3 categories I would have a color scheme of red, green, orange and blue never appears but I always want blue to be the last color.

I essentially want the series color to stay in the same order but be applied in reverse the trouble is not knowing how many colors will be needed in the series as it could be 3 like the above example or for my teammate who has 4 or maybe it is 7 or 8 which the dynamic number of how many colors of the series and applying that in reverse order is where I have run into an issue.
 
Posts: 10 | Registered: June 19, 2018Report This Post
Expert
posted Hide Post
Try this. I started with a report, did Stop Lights, then changed it to a Chart and changed a few things (TYPE=DATA, COLUMN=N2 ... WHEN=N2 GT #000000 ... COLOR=RGB(### ### ###)
ENGINE INT CACHE SET ON
SET PAGE-NUM=NOLEAD
-DEFAULTH &WF_HTMLENCODE=OFF;
SET HTMLENCODE=&WF_HTMLENCODE

SET ARGRAPHENGINE=JSCHART
-DEFAULTH &WF_EMPTYREPORT=ON;
SET EMPTYREPORT=&WF_EMPTYREPORT

SET EMBEDHEADING=ON
SET GRAPHDEFAULT=OFF
-DEFAULTH &WF_ARVERSION=2;
SET ARVERSION=&WF_ARVERSION

-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';

-DEFAULTH &WF_TITLE='WebFOCUS Report';
GRAPH FILE ibisamp/ggsales
-* Created by Info Assist for Graph
SUM GGSALES.SALES01.DOLLARS
BY GGSALES.SALES01.ST
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET LOOKGRAPH BAR
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT

setPieDepth(0);
setPieTilt(0);
setDepthRadius(0); 
setCurveFitEquationDisplay(false); 
setPlace(true); 

*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,$
TYPE=DATA, COLUMN=N2, WHEN=N2 GT 6000000, JUSTIFY=RIGHT, FONT='ARIAL', SIZE=9, COLOR=RGB(000 255 000), HYPERLINK-COLOR=RGB(20 20 20), BACKCOLOR=(RGB(158 255 160) RGB(158 255 160)), $
TYPE=DATA, COLUMN=N2, WHEN=N2 GT 4000000, JUSTIFY=RIGHT, FONT='ARIAL', SIZE=9, COLOR=RGB(000 000 255), HYPERLINK-COLOR=RGB(20 20 20), BACKCOLOR=(RGB(192 192 192) RGB(192 192 192)), $
TYPE=DATA, COLUMN=N1, BUCKET=x-axis, $
TYPE=DATA, COLUMN=N2, BUCKET=y-axis, $
*GRAPH_SCRIPT

setReportParsingErrors(false);
setSelectionEnableMove(false);

*END
ENDSTYLE
END

-RUN




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Virtuoso
posted Hide Post
Alex,
Could this help?
By changing the Region parameter, the colors flip:
  
-SET &ECHO=ALL;
-* File alexb01.fex

-DEFAULTH &Region=Southeast
-SET &S0=DECODE &Region(Midwest 0 Northeast 1 Southeast 2 West 3);
-SET &S1=DECODE &Region(Midwest 1 Northeast 2 Southeast 3 West 0);
-SET &S2=DECODE &Region(Midwest 2 Northeast 3 Southeast 0 West 1);
-SET &S3=DECODE &Region(Midwest 3 Northeast 0 Southeast 1 West 2);


ENGINE INT CACHE SET ON
SET PAGE-NUM=NOLEAD
-DEFAULTH &WF_HTMLENCODE=OFF;
SET HTMLENCODE=&WF_HTMLENCODE

SET ARGRAPHENGINE=JSCHART
-DEFAULTH &WF_EMPTYREPORT=ON;
SET EMPTYREPORT=&WF_EMPTYREPORT

SET EMBEDHEADING=ON
SET GRAPHDEFAULT=OFF
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';

-DEFAULTH &WF_TITLE='WebFOCUS Report';
GRAPH FILE GGSALES
-* Created by Info Assist for Graph
SUM UNITS
BY CATEGORY
BY DATE
IF REGION EQ &Region
IF DATE LT 19970101
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET LOOKGRAPH BAR
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT

setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);

*END
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $
TYPE=DATA, COLUMN=N1, BUCKET=color, $
TYPE=DATA, COLUMN=N2, BUCKET=x-axis, $
TYPE=DATA, COLUMN=N3, BUCKET=y-axis, $
*GRAPH_SCRIPT

setReportParsingErrors(false);
setSelectionEnableMove(false);

*END
*GRAPH_JS
"series": [

{ /* Blue */
"series": &S0,
"color": "#0072B2"
},
{ /* Orange */
"series": &S1,
"color": "#FF6800"
},
{ /* Green */
"series": &S2,
"color": "#228B22"
},
{ /* Red */
"series": &S3,
"color": "#CC2529"
}
]
*END

ENDSTYLE
END


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 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     [CLOSED] Dynamically Switching Series Color

Copyright © 1996-2020 Information Builders