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] setFillColor for optional measures in a chart

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] setFillColor for optional measures in a chart
 Login/Join
 
Guru
posted
Not sure what I'm missing here but I'm trying to create a simple bar chart with some optional color-coded measures (eg; DEALER_COST=BLUE SALES=RED, RETAIL-COST=YELLOW). I tried using slicers and traffic lights but no help so far. Please help!

I was hoping if there was another way to draw the series using the field name instead of 0,1,2 etc., setFillColor(getSeries(2),new Color(255,255,0));



 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';
-DEFAULT &DEALER_COST='';
-DEFAULT &SALES='';
-DEFAULT &RETAIL_COST='';
GRAPH FILE car
-* Created by Info Assist for Graph
SUM 
&DEALER_COST	CAR.BODY.DEALER_COST
&SALES			CAR.BODY.SALES
&RETAIL_COST	CAR.BODY.RETAIL_COST
BY CAR.ORIGIN.COUNTRY
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 1
ON GRAPH SET LOOKGRAPH VBAR
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);



&DEALER_COST.EVAL setFillColor(getSeries(0),new Color(0,127,192));
&SALES.EVAL setFillColor(getSeries(1),new Color(255,0,0));
&RETAIL_COST.EVAL setFillColor(getSeries(2),new Color(255,255,0));

*END
ENDSTYLE
END
-RUN 

This message has been edited. Last edited by: FP Mod Chuck,


-********************
Sandbox: 8206.10
Dev: 8201M
Prod:8009
-********************
 
Posts: 289 | Location: Houston,TX | Registered: June 11, 2004Report This Post
Virtuoso
posted Hide Post
Your syntax needs to prompt for the value of new Color. Remove all references in your code to & variables and try this instead. Keep in mind, you can either use the RGB or Hex. I've used Hex because it's easier to handle a single value in a parameter.

 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 car
-* Created by Info Assist for Graph
SUM 
CAR.BODY.DEALER_COST
CAR.BODY.SALES
CAR.BODY.RETAIL_COST
BY CAR.ORIGIN.COUNTRY
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 1
ON GRAPH SET LOOKGRAPH VBAR
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);

setFillColor(getSeries(0),new Color(&DEALER_COST.(<Blue,'#0000ff'>,<Red,'#ff0000'>,<Yellow,'#ffff00'>).Select Dealer Cost color.));
setTransparentBorderColor(getSeries(0), true);
setFillColor(getSeries(1),new Color(&RETAIL_COST.(<Blue,'#0000ff'>,<Red,'#ff0000'>,<Yellow,'#ffff00'>).Select Retail Cost color.));
setTransparentBorderColor(getSeries(1), true);
setFillColor(getSeries(2),new Color(&SALES.(<Blue,'#0000ff'>,<Red,'#ff0000'>,<Yellow,'#ffff00'>).Select Sales color.));
setTransparentBorderColor(getSeries(2), true);

*END
ENDSTYLE
END
-RUN 


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Virtuoso
posted Hide Post
Hi vaayu,
quote:
SUM
&DEALER_COST CAR.BODY.DEALER_COST
&SALES CAR.BODY.SALES
&RETAIL_COST CAR.BODY.RETAIL_COST


What &DEALER_COST, &SALES and &RETAIL_COST stands for ?

Are you trying to create an Ad Hoc report where only one of the three fields will be displayed on the report.
Meaning that these variables exist to have the proper field displayed based on a selection ?

If my assumption is right, you need to understand that it will result in display of only one measure.
So you'll always only have one series.
The getSeries(x) will always be x = 0.
You won't have to deal with getSeries(1) and getSeries(2).

The following is a sample of what I explain above.
Change the SET to see different color and value.
-SET &DEALER_COST = '-*';
-SET &SALES = '';
-SET &RETAIL_COST = '-*';

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';
-DEFAULT &DEALER_COST='';
-DEFAULT &SALES='';
-DEFAULT &RETAIL_COST='';
GRAPH FILE car
-* Created by Info Assist for Graph
SUM 
&DEALER_COST	CAR.BODY.DEALER_COST
&SALES		CAR.BODY.SALES
&RETAIL_COST	CAR.BODY.RETAIL_COST
BY CAR.ORIGIN.COUNTRY
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 1
ON GRAPH SET LOOKGRAPH VBAR
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);

&DEALER_COST.EVAL setFillColor(getSeries(0),new Color(0,127,192));
&SALES.EVAL setFillColor(getSeries(0),new Color(255,0,0));
&RETAIL_COST.EVAL setFillColor(getSeries(0),new Color(255,255,0));

*END
ENDSTYLE
END
-RUN 


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
Guru
posted Hide Post
MartinY,
Yes, these 3 chart measures are optional, its either all or one or more. If the user selects ALL then series0, 1, 2, makes sense but, when they choose only 1 or more from the list then I'm trying to make it the same color as ALL. the 3 parms are basically for visibility. I'd like to plot each measure with a certain color no matter what.
Hope it helps!


-********************
Sandbox: 8206.10
Dev: 8201M
Prod:8009
-********************
 
Posts: 289 | Location: Houston,TX | Registered: June 11, 2004Report This Post
Virtuoso
posted Hide Post
What you can do is something such as this (I like to have variable the tells what they are for, so I change a little yours) :

-* Below three var normally received from user's selection
-SET &DISP_SALES  = 'Y';
-SET &DISP_DEALER = 'Y';
-SET &DISP_RETAIL = 'Y';
-* *********************
-SET &DISP_ALL    = IF &DISP_SALES EQ 'Y' AND &DISP_DEALER EQ 'Y' AND &DISP_RETAIL EQ 'Y' THEN 'Y' ELSE 'N';

-SET &SHOW_SALES  = IF &DISP_SALES  EQ 'N' THEN '-*' ELSE '';
-SET &SHOW_DEALER = IF &DISP_DEALER EQ 'N' THEN '-*' ELSE '';
-SET &SHOW_RETAIL = IF &DISP_RETAIL EQ 'N' THEN '-*' ELSE '';

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 CAR
SUM 
&SHOW_SALES.EVAL  SALES
&SHOW_DEALER.EVAL DEALER_COST
&SHOW_RETAIL.EVAL RETAIL_COST
BY COUNTRY
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 1
ON GRAPH SET LOOKGRAPH VBAR
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);

-IF &DISP_ALL EQ 'Y' THEN GOTO DISPALL;
&SHOW_SALES.EVAL  setFillColor(getSeries(0),new Color(255,0,0));
&SHOW_DEALER.EVAL setFillColor(getSeries(0),new Color(0,127,192));
&SHOW_RETAIL.EVAL setFillColor(getSeries(0),new Color(255,255,0));
-GOTO ENDDISP
-DISPALL
setFillColor(getSeries(0),new Color(255,0,0));
setFillColor(getSeries(1),new Color(0,127,192));
setFillColor(getSeries(2),new Color(255,255,0));

-ENDDISP
*END
ENDSTYLE
END
-RUN 

My goal here was not to give you the whole solution since the above do work only for one selected measure or all.
If the user choose two measures (1st and 2nd, or 1st and 3rd, or 2nd and 3rd) you will need to adapt the sample.
Yours to find out and have proper code. This is basic programming to evaluate cases and perform action accordingly.


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
  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] setFillColor for optional measures in a chart

Copyright © 1996-2020 Information Builders