Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Solved] Common Color for High Level Groups in Advanced Graph Assist

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Solved] Common Color for High Level Groups in Advanced Graph Assist
 Login/Join
 
Member
posted
In the Car example below I would like to get all the bars for individual countries the same color. For example: Jaguar, Jensen and Triumph would all be blue and Peugot would be red. It seems simple, but I spent a good chunk of Friday trying various API methods to no avail.

-* File GroupColoredGraph.fex
GRAPH FILE CAR
SUM CAR.BODY.DEALER_COST
BY CAR.ORIGIN.COUNTRY
BY CAR.COMP.CAR
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HAXIS 770
ON GRAPH SET VAXIS 405
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH HBAR
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 2
ON GRAPH SET GRAPHSTYLE *
setTemplateFile("/images/tdg/template/IBISouthWestern.txt");
setReportParsingErrors(false);
setSelectionEnableMove(false);
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);
setDepthRadius(5);
setTransparentBorderColor(getChartBackground(),true);
setPlace(true);
ENDSTYLE
END

This message has been edited. Last edited by: M. Meagher,


Developer Studio 7.7.05
Application Studio 8.0.09
Windows 7
All Formats
 
Posts: 16 | Location: Seattle, WA | Registered: November 29, 2012Report This Post
Expert
posted Hide Post
Have you considered using Conditional Formatting? Something like this:
ON GRAPH SET STYLE *
     SQUEEZE=ON,     ORIENTATION=PORTRAIT,$
DEFMACRO=COND0001,     MACTYPE=RULE,     WHEN=N1 EQ 'AUDI',$
DEFMACRO=COND0002,     MACTYPE=RULE,     WHEN=N1 EQ 'JAGUAR',$
DEFMACRO=COND0003,     MACTYPE=RULE,     WHEN=N1 EQ 'BMW',$
DEFMACRO=COND0004,     MACTYPE=RULE,     WHEN=N1 EQ 'MASERATI',$
TYPE=REPORT,     GRID=OFF,     FONT='TIMES NEW ROMAN',     SIZE=10,$
TYPE=DATA,     COLOR=RGB(240 240 240),$
TYPE=DATA,     ACROSSCOLUMN=N1,     MACRO=COND0001, COLOR=RED,$
TYPE=DATA,     ACROSSCOLUMN=N1,     MACRO=COND0002, COLOR=GREEN,$
TYPE=DATA,     ACROSSCOLUMN=N1,     MACRO=COND0003, COLOR=BLUE,$
TYPE=DATA,     ACROSSCOLUMN=N1,     MACRO=COND0004, COLOR=BLUE,$
ENDSTYLE
Smiler




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Member
posted Hide Post
I will give that a try and get back to you.


Developer Studio 7.7.05
Application Studio 8.0.09
Windows 7
All Formats
 
Posts: 16 | Location: Seattle, WA | Registered: November 29, 2012Report This Post
Expert
posted Hide Post
Thanks and Enjoy. I think it'll work out nicely for you as long as you know what items will be what colors. that can be done programatically...
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Member
posted Hide Post
It is not using the macros. All the bars are using the COLOR=RGB(240 240 240). I tried several variations on the macro theme and none successfully set the correct bar colors.


  
GRAPH FILE CAR
-* Created by Advanced Graph Assistant
SUM CAR.BODY.DEALER_COST
BY CAR.ORIGIN.COUNTRY
BY CAR.COMP.CAR
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HAXIS 770
ON GRAPH SET VAXIS 405
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH HBAR
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 2
ON GRAPH SET STYLE *
DEFMACRO=COND0001,     MACTYPE=RULE,     WHEN=N1 EQ 'AUDI',$
DEFMACRO=COND0002,     MACTYPE=RULE,     WHEN=N1 EQ 'JAGUAR',$
DEFMACRO=COND0003,     MACTYPE=RULE,     WHEN=N1 EQ 'BMW',$
DEFMACRO=COND0004,     MACTYPE=RULE,     WHEN=N1 EQ 'MASERATI',$
TYPE=REPORT,     GRID=OFF,     FONT='TIMES NEW ROMAN',     SIZE=10,$
TYPE=DATA,     COLOR=RGB(240 240 240),$
TYPE=DATA,     ACROSSCOLUMN=N1,     MACRO=COND0001, COLOR=RED,$
TYPE=DATA,     ACROSSCOLUMN=N1,     MACRO=COND0002, COLOR=GREEN,$
TYPE=DATA,     ACROSSCOLUMN=N1,     MACRO=COND0003, COLOR=BLUE,$
TYPE=DATA,     ACROSSCOLUMN=N1,     MACRO=COND0004, COLOR=BLUE,$
ENDSTYLE
END


Developer Studio 7.7.05
Application Studio 8.0.09
Windows 7
All Formats
 
Posts: 16 | Location: Seattle, WA | Registered: November 29, 2012Report This Post
Expert
posted Hide Post
The code from my 13:31 post should have been added to your code, Here's the complete, functional code, for starters:
TABLE FILE CAR
BY CAR
ON TABLE HOLD
END
-RUN
-SET &NumberOfSeries = &LINES * 1 ;
-TYPE We have &NumberOfSeries cars to graphs...
-SET &NumberOfSeries = &NumberOfSeries - 1 ;
-SET &LoopCounter = 0 ;
GRAPH FILE CAR
SUM MAX.CAR.BODY.SEATS
ACROSS CAR.COMP.CAR
BY CAR.COMP.CAR
ON GRAPH SET LOOKGRAPH VBAR
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 VAXIS 600
ON GRAPH SET HAXIS 900
ON GRAPH SET GRMERGE ON
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHSTYLE *
setMarkerDisplay(true);
setConnectLineMarkers(false);
setConnectScatterMarkers(false);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(true);
setO1MajorGridStyle(0);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
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);
setTextJustHoriz(getLegendText(),1);
setFontSizeAbsolute(getLegendText(),true);
setFontSize(getLegendText(),10);
setTextRotation(getLegendText(),0);
setTextWrap(getLegendText(),false);
setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeAbsolute(getY2Title(),true);
setFontSizeAbsolute(getY2Label(),true);
setFontSizeAbsolute(getO1Title(),true);
setPlaceResize(getLegendText(),0);
setPlaceRotate(getLegendText(),0);
setPlaceAlign(getLegendText(),0);
setPlaceWordWrap(getLegendText(),0);
setPlace(true);
-* THE FOLLOWING LOOP DOES THE SAME THING AS THE STYLESHEET ITEMS BELOW.
-*-REPEAT EndOfLoop FOR &LoopCounter FROM 0 TO &NumberOfSeries ;
-*-SET &ThisColor = '000,000,255' ;
-*setFillColor(getSeries( &LoopCounter ), new Color( &ThisColor ));
-*-EndOfLoop
-* Display a legend or not (true or false)
-*setLegendDisplay(false);
ENDSTYLE
ON GRAPH SET STYLE *
     SQUEEZE=ON,     ORIENTATION=PORTRAIT,$
DEFMACRO=COND0001,     MACTYPE=RULE,     WHEN=N1 EQ 'AUDI',$
DEFMACRO=COND0002,     MACTYPE=RULE,     WHEN=N1 EQ 'JAGUAR',$
DEFMACRO=COND0003,     MACTYPE=RULE,     WHEN=N1 EQ 'BMW',$
DEFMACRO=COND0004,     MACTYPE=RULE,     WHEN=N1 EQ 'MASERATI',$
TYPE=REPORT,     GRID=OFF,     FONT='TIMES NEW ROMAN',     SIZE=10,$
TYPE=DATA,     COLOR=RGB(240 240 240),$
TYPE=DATA,     ACROSSCOLUMN=N1,     MACRO=COND0001, COLOR=RED,$
TYPE=DATA,     ACROSSCOLUMN=N1,     MACRO=COND0002, COLOR=GREEN,$
TYPE=DATA,     ACROSSCOLUMN=N1,     MACRO=COND0003, COLOR=BLUE,$
TYPE=DATA,     ACROSSCOLUMN=N1,     MACRO=COND0004, COLOR=BLUE,$
ENDSTYLE
END
-RUN
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Member
posted Hide Post
Doug,

Thank you for the help.

There is still a fundamental difference between your examples and my requirements. You are using an ACROSS and BY on CAR. I have to use BY COUNTRY, then BY CAR for my application. It changes the way the MACROs are defined and used. I cannot use ACROSSCOLUMN to assign the colors.

I used your looping method with my code. It counts the number of countries (5) and sets the first five COUNTRY/CAR combinations blue. I may be able to trick it into changing colors when the country changes.

TABLE FILE CAR
BY COUNTRY
ON TABLE HOLD
END
-RUN
-SET &NumberOfSeries = &LINES * 1 ;
-TYPE We have &NumberOfSeries cars to graphs...
-SET &NumberOfSeries = &NumberOfSeries - 1 ;
-SET &LoopCounter = 0 ;
-RUN
GRAPH FILE CAR
SUM CAR.BODY.DEALER_COST
BY CAR.ORIGIN.COUNTRY
BY CAR.COMP.CAR
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HAXIS 770
ON GRAPH SET VAXIS 405
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH HBAR
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 2
ON GRAPH SET GRAPHSTYLE *
setTemplateFile("/images/tdg/template/IBISouthWestern.txt");
setReportParsingErrors(false);
setSelectionEnableMove(false);
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);
setDepthRadius(5);
setTransparentBorderColor(getChartBackground(),true);
setPlace(true);
-* THE FOLLOWING LOOP DOES THE SAME THING AS THE STYLESHEET ITEMS BELOW.
-REPEAT EndOfLoop FOR &LoopCounter FROM 0 TO &NumberOfSeries ;
-SET &ThisColor = '000,000,255' ;
setFillColor(getSeries( &LoopCounter ), new Color( &ThisColor ));
-EndOfLoop
-* Display a legend or not (true or false)
setLegendDisplay(false);
ENDSTYLE
END
-RUN


Developer Studio 7.7.05
Application Studio 8.0.09
Windows 7
All Formats
 
Posts: 16 | Location: Seattle, WA | Registered: November 29, 2012Report This Post
Member
posted Hide Post
The problem ended up being the inclusion of
'setTemplateFile("/images/tdg/template/IBISouthWestern.txt");' I commented it out and the bars colored correctly.

-* File GroupColoredGraph.fex
GRAPH FILE CAR
-* Created by Advanced Graph Assistant
SUM CAR.BODY.DEALER_COST
BY CAR.ORIGIN.COUNTRY
BY CAR.COMP.CAR
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HAXIS 770
ON GRAPH SET VAXIS 405
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH HBAR
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 2
ON GRAPH SET GRAPHSTYLE *
-*setTemplateFile("/images/tdg/template/IBISouthWestern.txt");
setReportParsingErrors(false);
setSelectionEnableMove(false);
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);
setTransparentBorderColor(getChartBackground(),true);
setPlace(true);
ENDSTYLE
ON GRAPH SET STYLE *
DEFMACRO=COND0001, COLOR=RGB(255 255 0), WHEN=COUNTRY EQ 'JAPAN', $
DEFMACRO=COND0002, COLOR=RGB(0 100 0),   WHEN=COUNTRY EQ 'ENGLAND', $
DEFMACRO=COND0003, COLOR=RGB(255 0 255), WHEN=COUNTRY EQ 'FRANCE', $
DEFMACRO=COND0004, COLOR=RGB(220 20 60), WHEN=COUNTRY EQ 'ITALY', $
DEFMACRO=COND0005, COLOR=RGB(255 215 0), WHEN=COUNTRY EQ 'W GERMANY', $
TYPE=REPORT, FONT='TIMES NEW ROMAN', SIZE=10, GRID=OFF, SQUEEZE=ON, $
TYPE=DATA, COLUMN=DEALER_COST, MACRO=COND0001, $
TYPE=DATA, COLUMN=DEALER_COST, MACRO=COND0002, $
TYPE=DATA, COLUMN=DEALER_COST, MACRO=COND0003, $
TYPE=DATA, COLUMN=DEALER_COST, MACRO=COND0004, $
TYPE=DATA, COLUMN=DEALER_COST, MACRO=COND0005, $
ENDSTYLE
END


Developer Studio 7.7.05
Application Studio 8.0.09
Windows 7
All Formats
 
Posts: 16 | Location: Seattle, WA | Registered: November 29, 2012Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Solved] Common Color for High Level Groups in Advanced Graph Assist

Copyright © 1996-2020 Information Builders