Originally posted by Tamra:
The Charting Product Manager replied with the following example:
DEFINE FILE CAR
SORT /I1 = DECODE COUNTRY ('JAPAN' 1 'ENGLAND' 2 ELSE 3);
MEAS_LAT /P10C = IF BODYTYPE EQ 'SEDAN' THEN RETAIL_COST ELSE 0;
MEAS_OUT /P10C = IF BODYTYPE NE 'SEDAN' THEN RETAIL_COST ELSE 0;
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 MEAS_LAT AS 'LATEST'
MEAS_OUT AS 'OUTDATED'
BY SORT NOPRINT
BY COUNTRY AS ''
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 2
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);
setDisplay(getDataText(0), true);
setDataTextDisplay(true);
*END
*GRAPH_JS
dataLabels: {
formatCallback: function(d, s, g) {
var sum = d.value / pv.sum(this.data.map(function(el){return el[g];}), function(el){return el.value;});
return this.formatNumber(d.value, '$#') + ' ' + this.formatNumber(sum, '#%');
}
},
*END
ENDSTYLE
END
-RUN
Thank you for participating in the Focal Point Forum!
Tamra Colangelo
Focal Point Moderator
Information Builders