When creating a pie chart I have three possible values breaking out into slices. When all three come back, they are populated with the colors in series 0, 1, and 2 respectively and all is fine. But when only two values come back, they populate with the colors in series 0 and 1 and could have different colors then before. I'd like to keep the colors consistant when either 1 or 2 values are missing. Is there a way to assign actual breakdown values to the series colors?This message has been edited. Last edited by: Kerry,
WebFOCUS 7.6 Windows, All Outputs
October 25, 2011, 03:17 PM
Sayed
Can you post your code on what you're trying to do?
Thanks, Sayed
WF 8.x and 7.7.x Win/UNIX/AS400, MRE/Portal/Self-Service, IIS/Tomcat, WebSphere, IWA, Realmdriver, Active Directory, Oracle, SQLServer, DB2, MySQL, JD Edwards, E-BIZ, SAP BW, R/3, ECC, ESSBASE
October 25, 2011, 03:38 PM
Doug Higgins
-*Do not delete or modify the comments below
-*Do not delete or modify the comments above GRAPH FILE CRITHOLD -* Created by Advanced Graph Assistant SUM CNT.CRITHOLD.SEG01.SRVY_RCMN_STAT_NA AS 'Status' BY CRITHOLD.SEG01.SRVY_RCMN_STAT_NA ON GRAPH PCHOLD FORMAT PNG ON GRAPH SET HTMLENCODE ON ON GRAPH SET GRAPHDEFAULT OFF ON GRAPH SET VZERO OFF ON GRAPH SET HAXIS 275 ON GRAPH SET VAXIS 225 ON GRAPH SET UNITS PIXELS ON GRAPH SET LOOKGRAPH PIESINGL ON GRAPH SET GRMERGE ADVANCED ON GRAPH SET GRMULTIGRAPH 0 ON GRAPH SET GRLEGEND 1 ON GRAPH SET GRXAXIS 0 ON GRAPH SET GRAPHSTYLE * setTemplateFile("/images/tdg/template/IBISouthWestern.txt"); setReportParsingErrors(false); setSelectionEnableMove(false); setDepthRadius(5); setTransparentBorderColor(getSeries(0),true); setTransparentBorderColor(getSeries(1),true); setTransparentBorderColor(getSeries(2),true); setTransparentBorderColor(getSeries(3),true); setTransparentBorderColor(getSeries(4),true); setTransparentBorderColor(getSeries(5),true); setTransparentBorderColor(getSeries(6),true); setTransparentBorderColor(getSeries(7),true); setTransparentBorderColor(getSeries(8),true); setTransparentBorderColor(getSeries(9),true); setTransparentBorderColor(getSeries(10),true); setPieDepth(10); setPieFeelerTextDisplay(1); setTransparentBorderColor(getChartBackground(),true); setPlace(true); setPieLabelDisplay(0); setTextFormatPreset(getPieSliceLabel(),-1); setFontStyle(getTitle(),0); setDisplay(getPieLabel(),false); setLegendPosition(4); setPieSliceDetach(getSeries(0),100); setPieSliceDetach(getSeries(1),100); setFontSizeAbsolute(getPieSliceLabel(),true); setFontSizeInPoints(getPieSliceLabel(),10); setPlaceResize(getPieSliceLabel(),0); setFontSizeAbsolute(getLegendText(),true); setFontSizeInPoints(getLegendText(),10); setPlaceResize(getLegendText(),0); setFontSizeAbsolute(getTitle(),true); setFontSizeInPoints(getTitle(),12); setPlaceResize(getTitle(),0); setFillColor(getSeries(0),new Color(58,88,142)); setFillColor(getSeries(1),new Color(106,138,195)); setFillColor(getSeries(2),new Color(179,194,223)); setTextString(getSubtitle(),"&DATEMDYY"); setDisplay(getSubtitle(),true); setFontStyle(getSubtitle(),0); setTextString(getTitle(),"Locations Surveyed with Risk Improvement Recs"); setDisplay(getTitle(),true); ENDSTYLE
Thanks!
WebFOCUS 7.6 Windows, All Outputs
October 25, 2011, 04:53 PM
Waz
There is probably a simpler way, but I would suggest setting the colours for the series by each value of the BY field.
e.g.
DEFINE FILE CRITHOLD
FillColour/A11 = DECOODE SRVY_RCMN_STAT_NA(Val0 '58,88,142' Val1 '106,138,195' Val2 '179,194,223' ELSE '127,127,127') ;
END
TABLE FILE CRITHOLD
SUM MAX FillColour
BY SRVY_RCMN_STAT_NA NOPRINT
ON TABLE SAVE AS SETCOL
END
-RUN
-SET &SerCnt = &LINES - 1 ;
.
.
.
GRAPH FILE
.
.
.
ON GRAPH SET
.
.
.
-REPEAT ColVars FOR &Series FROM 0 TO &SerCnt ;
-READ SETCOL &Colour.A11.
-SET &Colour = TRUNCATE(&Colour) ;
setFillColor(getSeries(&Series),new Color(&Colour));
-ColVars
.
.
.
ENDSTYLE
END