Focal Point
[SOLVED] Bar Graph - Set different bar colors for HTML5 output (Webfocus v8)

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

October 01, 2013, 12:26 AM
WF1326
[SOLVED] Bar Graph - Set different bar colors for HTML5 output (Webfocus v8)
Hi,

I have been trying to set different colors for each bar in a bar graph in WebFOCUS v8. I have used format output 'JSCHART'(HTML5 output), which gives a single color to all the bars. When i switch to PNG i could get the result that i want, but i need the output to be in JSCHART.

Is there a way to set separate colors to the bars with the format output JSCHART?.

Here is the car file:

GRAPH FILE CAR
SUM DEALER_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 UNITS PIXELS
ON GRAPH SET HAXIS 400
ON GRAPH SET VAXIS 700
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='WebFOCUS Report', $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
*END
ENDSTYLE
END

Thank you in advance.

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS
7703/7705/8105m/8201m/8202m

October 01, 2013, 11:20 AM
WF1326
Found out the solution for setting colors: Replace the default styling with the code below.

Note: "ON GRAPH SET VZERO ON". You can also comment it out, if it is not required.

GRAPH FILE CAR
SUM DEALER_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 UNITS PIXELS
ON GRAPH SET HAXIS 400
ON GRAPH SET VAXIS 700
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
setFillColor(getSeries(0),new Color(143,182,52));
setFillColor(getSeries(1),new Color(0,18,26));
setFillColor(getSeries(2),new Color(143,182,52));
setFillColor(getSeries(3),new Color(10,11,236));
setFillColor(getSeries(4),new Color(153,182,62));

*END

*GRAPH_JS
'mouseOverIndicator':{
'enabled':true,
'color':'yellow',
'marker':{'size':0}
},
'introAnimation':{
'enabled':true,
'duration':1400
},
'riserBevel':'bevel'
*END
END

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


WebFOCUS
7703/7705/8105m/8201m/8202m