Focal Point
Bar Graph: Conditional Formatting of X Axis TEXT

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

May 07, 2010, 02:38 PM
Doug
Bar Graph: Conditional Formatting of X Axis TEXT
Is there a way, and I'm sure there is, to conditionally format the X Axis based on its value as seen in the below code. In this example I'd like to, as a POC, change the font color of ITALY, JAPAN, and W. GERMANY to red. The change needs to be done conditionally, i.e.: WHEN COUNTRY GE 'ITALY'.

I counldn't find this in the AGA?

Here's some sample code:
-*
-*
-*INTERNAL_PROPERTIES$fieldDisplayMode=label;OBJECTID=GLOBAL
-*INTERNAL_PROPERTIES$enablePreview=true;OBJECTID=GLOBAL
-*INTERNAL_PROPERTIES$prefixDisplayMode=;OBJECTID=GLOBAL
-*INTERNAL_PROPERTIES$GlobalRecordLimit=500;OBJECTID=GLOBAL
-*INTERNAL_PROPERTIES$SampleData=false;OBJECTID=GLOBAL
GRAPH FILE CAR
-* Created by Advanced Graph Assistant
HEADING
"Conditional Formatting of the X Axis title"
"Change the font color of ITALY, JAPAN, and W. GERMANY to red"
"The change needs to be done with Conditional Formatting"
"i.e.: WHEN COUNTRY GE 'ITALY'"
SUM CAR.BODY.DEALER_COST AS 'COST'
BY CAR.ORIGIN.COUNTRY AS ''
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO ON
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET HAXIS 770
ON GRAPH SET VAXIS 405
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET GRID ON
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 1
ON GRAPH SET GRAPHSTYLE *
setTemplateFile("/images/tdg/template/IBISouthWestern.txt");
setReportParsingErrors(false);
setSelectionEnableMove(false);
setDepthRadius(5);
setTransparentBorderColor(getChartBackground(),true);
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);
setMarkerDisplay(true);
setConnectLineMarkers(false);
setConnectScatterMarkers(false);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(true);
setO1MajorGridStyle(0);
setO1MinorGridDisplay(false);
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);
setFillColor(getDataText(),new Color(0,0,255));
setFillColor(getSeries(0),new Color(0,94,187));
setFillColor(getY1Title(),new Color(0,0,0));
ENDSTYLE
ON GRAPH SET STYLE *
TYPE=REPORT, FONT='VERDANA', SIZE=9, STYLE=BOLD, GRID=OFF, SQUEEZE=ON, $
TYPE=TITLE, COLOR=RGB(255 0 0), $
ENDSTYLE
END

Thanks in Advance (pun intended),
Doug

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




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
May 07, 2010, 03:53 PM
Dan Satchell
Perhaps this post will help: Applying Conditional Styling to a Graph


WebFOCUS 7.7.05
May 07, 2010, 04:05 PM
GinnyJakes
Dave, you'd have to know the series number in advance in order to do what you want in the AGA.

However, you can possibly use ROWS OVER and/or pieces of the technique I posted here
http://forums.informationbuild...311015262#3311015262
using Dialogue Mananger after figuring out which series had which value.

I think there are a few other posts about changing series colors on the fly.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
May 07, 2010, 05:35 PM
Doug
Thanks to both of you... However, these tips are "series" related. I only have one series and it's not the "bars" that I want to format. It's the X-Axis (title) such as 'ENGLAND', 'JAPAN', and 'W. GERMANY', not there values.

Perhaps I should tell where this is heading... So, Here goes... I need to produce multiple graphs, each graph and all bars within the graphs need to be of the same width (ON GRAPH SET HAXIS 970) and the bars are (we'll say) 90 wide. When I have ten items to graphs, I get a nice graphs... I need to have the same look and feel (width, etc) as that when I have less then 10 items to be graphed. So, I need to create "dummy" items with a value of zero to make up for having less then ten items.

Perhaps there's a better way... I'm open to it all...

Example: Let's say that I needed the above graph (previously presented code) to be presented and 'W. GERMANY' have no DCOST and the graph needed to look the same, except this time there's only four countries to show.