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     [SOLVED] Chart Colors by Group

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Chart Colors by Group
 Login/Join
 
Gold member
posted
I have a stacked bar chart with multiple groupings (2 XAXIS), and I need to have different colors for each of the major groupings, so that the user can easily see when a group ends and the next begins.

For example:
Midwest – Light Blue / Light Green
Northeast – Dark Blue / Dark Green
Southeast – Light Blue / Light Green
West – Dark Blue / Dark Green

I’ve tried to play around with setColorMode(2), but that only works if you have a single group/XAXIS, not multiple like I have.

Any ideas?

  
ENGINE INT CACHE SET ON
-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 GGSALES.SALES01.DOLLARS
GGSALES.SALES01.BUDDOLLARS
BY GGSALES.SALES01.REGION
BY GGSALES.SALES01.CATEGORY
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET GRWIDTH 1
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
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
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setColorMode(1);
setFillColor(getSeries(0),new Color(0, 145, 218));
setFillColor(getSeries(1),new Color(0, 196, 217));
*END
ENDSTYLE
END
-RUN

This message has been edited. Last edited by: Joel Elscott,


WebFOCUS 8.2.03
z/OS
 
Posts: 66 | Registered: May 20, 2013Report This Post
Virtuoso
posted Hide Post
Is this may suit your need ?
ENGINE INT CACHE SET ON
-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 GGSALES.SALES01.DOLLARS
    GGSALES.SALES01.BUDDOLLARS
BY GGSALES.SALES01.REGION
BY GGSALES.SALES01.CATEGORY
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET GRWIDTH 1
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 1
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
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setColorMode(1);
-*setFillColor(getSeries(0),new Color(200, 145, 218));
-*setFillColor(getSeries(1),new Color(200, 196, 217));
-*setFillColor(getSeries(2),new Color(100, 145, 218));
-*setFillColor(getSeries(3),new Color(100, 196, 217));
-*setFillColor(getSeries(4),new Color(150, 145, 218));
-*setFillColor(getSeries(5),new Color(150, 196, 217));
-*setFillColor(getSeries(6),new Color(0, 145, 218));
-*setFillColor(getSeries(7),new Color(0, 196, 217));
*END
ENDSTYLE
END
-RUN

Pay attention to:
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 1

To have your own color set, you must uncomment the lines


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Gold member
posted Hide Post
Thank you Martin, but unfortunately I don't think my users would go for this. I would need to keep all the labels intact if at all possible.

I really appreciate the idea though, and could maybe use for a different scenario. Thanks again!


WebFOCUS 8.2.03
z/OS
 
Posts: 66 | Registered: May 20, 2013Report This Post
Virtuoso
posted Hide Post
Maybe that way:
ENGINE INT CACHE SET ON
-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 GGSALES.SALES01.DOLLARS
    GGSALES.SALES01.BUDDOLLARS
BY GGSALES.SALES01.REGION NOPRINT
BY GGSALES.SALES01.REGION
BY GGSALES.SALES01.CATEGORY
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET GRWIDTH 1
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
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
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setColorMode(1);
-*setFillColor(getSeries(0),new Color(200, 145, 218));
-*setFillColor(getSeries(1),new Color(200, 196, 217));
-*setFillColor(getSeries(2),new Color(100, 145, 218));
-*setFillColor(getSeries(3),new Color(100, 196, 217));
-*setFillColor(getSeries(4),new Color(150, 145, 218));
-*setFillColor(getSeries(5),new Color(150, 196, 217));
-*setFillColor(getSeries(6),new Color(0, 145, 218));
-*setFillColor(getSeries(7),new Color(0, 196, 217));
*END
ENDSTYLE
END
-RUN

Pay attention to:
BY GGSALES.SALES01.REGION NOPRINT
BY GGSALES.SALES01.REGION
BY GGSALES.SALES01.CATEGORY
...
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 2


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Gold member
posted Hide Post
This is perfect, thank you!! Now I just need to figure out how to implement this into my much more complicated app. Thanks again!


WebFOCUS 8.2.03
z/OS
 
Posts: 66 | Registered: May 20, 2013Report 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     [SOLVED] Chart Colors by Group

Copyright © 1996-2020 Information Builders