Focal Point
[CLOSED] The value of x axis legend can not display correctly

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7057051586

January 08, 2017, 10:50 AM
S.G
[CLOSED] The value of x axis legend can not display correctly
I've got a request to show a vertical percent bar graph and display the legend of X axis. But with the code, the values of the legends can not display correctly. Example the value of MAINT is 40 and the value of NO-MAINT is 60,so the percent of MAINT = MAINT/(MAINT+NO-MAINT)*100 and the percent of NO-MAINT = NO-MAINT/(MAINT+NO-MAINT)*100; The stacked bar would show 40% MAINT and 60% NO-MAINT with different yellow and blue colour. So the yellow legend should display NO-MAINT, and blue legend should display MAINT. But with my code, the yellow or blue legend will always display MAINT.

Looking for forward to your suggestion. Thanks in advance!

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


WebFOCUS 8105
Windows, All Outputs
January 09, 2017, 08:01 AM
MartinY
Hi S.G.

Having your code may help us to help you but without that, here what I would do instead.

I understand that it may not be exactly what you've been requested, but in your case I will do the following (especially to display percentage as of a bar graph) :

DEFINE FILE CAR
REGION /A10V  = DECODE COUNTRY ('FRANCE' 'EAST' 'ENGLAND' 'EAST' 'ITALY' 'EAST' ELSE 'WEST');
END
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 COMPUTE RETPCT/P8.2%=RETAIL_COST/( RETAIL_COST + DEALER_COST ) * 100 ;
COMPUTE DELPCT/P8.2%=DEALER_COST/( RETAIL_COST + DEALER_COST ) * 100 ;
BY CAR.ORIGIN.REGION
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT 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 GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 1
ON GRAPH SET LOOKGRAPH VBRSTKPC
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);
*END
ENDSTYLE
END
-RUN

The thing is that in fact, the way that you present it, your MAINT and NO-MAINT are two different measures but it seems that they are displayed as only one.
My above sample have two measures displayed in one bar but where each keeps their own label.


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