Focal Point
[SOLVED] Set different font color for data results in bars in a graph

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

May 29, 2017, 06:11 AM
Dragan
[SOLVED] Set different font color for data results in bars in a graph
Hi guys

For now I was able to change the color for all dataLabels or for negative results.
Is there a way to change the color of each series data results?
Thanks in advance
dragan

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


WebFOCUS 8
Windows, All Outputs
May 30, 2017, 08:43 AM
BabakNYC
I'm not sure if you want the series color or the data label. But basic control over the series color could be something like this:

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 ibisamp/car
-* Created by Info Assist for Graph
SUM CAR.BODY.SALES
BY CAR.ORIGIN.COUNTRY
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET ARGRAPHENGIN JSCHART
ON GRAPH SET EMBEDHEADING ON
ON GRAPH SET VZERO 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 LOOKGRAPH BAR
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/ibi_themes/Warm.sty,$
DEFMACRO=Condition_1, MACTYPE=RULE, WHEN=N2 GT 80000, $
DEFMACRO=Condition_2, MACTYPE=RULE, WHEN=N2 LT 48000, $
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, ORIENTATION=LANDSCAPE, $
TYPE=DATA, COLUMN=N1, BUCKET=x-axis, $
TYPE=DATA, COLUMN=N2, BUCKET=y-axis, $
TYPE=DATA, COLUMN=N2, MACRO=Condition_1, COLOR=RGB(128 255 128), HYPERLINK-COLOR=RGB(128 255 128), $
TYPE=DATA, COLUMN=N2, MACRO=Condition_2, COLOR=RGB(255 0 0), HYPERLINK-COLOR=RGB(255 0 0), $
*GRAPH_SCRIPT

setReportParsingErrors(false);
setSelectionEnableMove(false);

*END
ENDSTYLE
END

-RUN





WebFOCUS 8206, Unix, Windows
June 06, 2017, 03:10 AM
Dragan
Thank you BabakNYC

Your example looks great, I'll try to implement it in my report.
It didn't occur to me that one can use "classical" column colouring for graphs and specially for js graphs too. I was able to implement it on tables but not yet on graphs.

Thank you
Kind Regards
Dragan


WebFOCUS 8
Windows, All Outputs