Focal Point
Conditional Styling (Stacked Bar Graph)

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

November 04, 2006, 02:54 PM
neuro
Conditional Styling (Stacked Bar Graph)
I am trying to conditionally style the following code that is setup just like a report I am trying to create.
I want to be able to change the colors for each Car. Example would be in Japan and W Germany, how can I have BMW in W Germany be lets say "BLUE" instead of Pink??? This is easy when there are only two things to graph, but adding the third element has been difficult.
Thank you to anyone that could possibly help!



GRAPH FILE CAR
SUM CAR.BODY.SALES
ACROSS CAR.ORIGIN.COUNTRY
BY CAR.COMP.CAR
HEADING
""
ON GRAPH SET LOOKGRAPH VBRSTK1
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET VZERO ON
ON GRAPH SET GRID ON
ON GRAPH SET GRMERGE ON
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHSTYLE *
setLegendMarkerPosition(4);
setMarkerDisplay(true);
setConnectLineMarkers(false);
setConnectScatterMarkers(false);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(true);
setO1MajorGridStyle(0);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
setSeriesType(0,1);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"#.##");
setPieFeelerTextDisplay(1);
setPieLabelDisplay(0);
setTextFormatPreset(getPieSliceLabel(),1);
setRiserBorderMode(1);
setSeriesDefaultTransparentBorderColor(true);
setUseSeriesBorderDefaults(true);
setLegendDisplay(true);
setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeAbsolute(getY2Title(),true);
setFontSizeAbsolute(getY2Label(),true);
setFontSizeAbsolute(getO1Title(),true);
setPlace(true);
ENDSTYLE
ON GRAPH SET STYLE *
PAGESIZE='Letter',
LEFTMARGIN=0.250000,
RIGHTMARGIN=0.250000,
TOPMARGIN=0.250000,
BOTTOMMARGIN=0.250000,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='TIMES NEW ROMAN',
SIZE=10,
BACKCOLOR='NONE',
STYLE=NORMAL,
$
TYPE=HEADING,
LINE=1,
OBJECT=FIELD,
ITEM=1,
COLOR='BLACK',
$
ENDSTYLE
END

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


Currenly working @ Learning Circle Education Services
Previously worked @ Nationwide Insurance
Prod: WebFOCUS 7.6.11


Test: WebFOCUS 7.6.11


Dev: WebFOCUS 7.6.11
November 06, 2006, 04:24 AM
Tony A
neuro,

Use the java to change the colour for a specific series -
setFillType(getSeries(0),1);
setSeriesFillColor(0,new Color(170,250,255));
setFillType(getSeries(1),1);
setSeriesFillColor(1,new Color(170,175,255));
setFillType(getSeries(2),1);
setSeriesFillColor(2,new Color(170,100,255));
setFillType(getSeries(3),1);
setSeriesFillColor(3,new Color(100,250,255));
setFillType(getSeries(4),1);
setSeriesFillColor(4,new Color(100,175,255));
setFillType(getSeries(5),1);
setSeriesFillColor(5,new Color(100,100,255));

You could, of course, use a variable instead of the rgb values.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
November 06, 2006, 09:07 AM
BlueZone
You could try this one.....with your own RGB preferences

setFillColor(getSeries(0), new Color(0,0,255));
setFillColor(getSeries(1), new Color(0,255,0));
setFillColor(getSeries(2), new Color(255,0,255));
setFillColor(getSeries(3), new Color(255,255,0));
setFillColor(getSeries(4), new Color(255,0,0));
setFillColor(getSeries(5), new Color(255,165,0));
setFillColor(getSeries(6), new Color(255,192,203));
setFillColor(getSeries(7), new Color(0,255,255));
setFillColor(getSeries(8), new Color(206,0,54));
setFillColor(getSeries(9), new Color(255,239,0));
setFillColor(getSeries(10), new Color(0,152,82));
....
....
Goooooooooooooooood day !!


-------------------------------------------------------------------------------------------------
Blue Cross & Blue Shield of MS
WF.76-10 on (WS2003 + WebSphere) / EDA on z/OS + DB2 + MS-SQL
MRE, BID, Dev. Studio, Self-Service apps & a dash of fun !! Music
November 20, 2006, 02:59 PM
neuro
Thank you this works great!


Currenly working @ Learning Circle Education Services
Previously worked @ Nationwide Insurance
Prod: WebFOCUS 7.6.11


Test: WebFOCUS 7.6.11


Dev: WebFOCUS 7.6.11