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.
I know there is a discussion on this topic. But did anyone figured it out a way that the bar and legend colors match?
Here is my sample code
GRAPH FILE CAR SUM SEATS BY CAR ACROSS COUNTRY WHERE COUNTRY EQ 'W GERMANY' OR 'JAPAN' ON GRAPH PCHOLD FORMAT JSCHART ON GRAPH SET VZERO OFF ON GRAPH SET HTMLENCODE ON ON GRAPH SET GRAPHDEFAULT OFF ON GRAPH SET GRWIDTH 1 ON GRAPH SET UNITS PIXELS ON GRAPH SET HAXIS 600 ON GRAPH SET VAXIS 400 ON GRAPH SET GRMERGE ADVANCED ON GRAPH SET GRMULTIGRAPH 0 ON GRAPH SET GRLEGEND 1 ON GRAPH SET GRXAXIS 1 ON GRAPH SET LOOKGRAPH VBRSTK1 ON GRAPH SET AUTOFIT OFF ON GRAPH SET STYLE * *GRAPH_SCRIPT setPieDepth(0); setPieTilt(0); setDepthRadius(0); setCurveFitEquationDisplay(false); setPlace(true); *END TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $ DEFMACRO=COND0001,MACTYPE=RULE,WHEN=CAR EQ 'AUDI',$ DEFMACRO=COND0002,MACTYPE=RULE,WHEN=CAR EQ 'BMW',$ DEFMACRO=COND0003,MACTYPE=RULE,WHEN=CAR EQ 'DATSUN',$ DEFMACRO=COND0004,MACTYPE=RULE,WHEN=CAR EQ 'TOYOTA',$ TYPE=DATA,COLOR=RGB(28 145 108),MACRO=COND0001,$ TYPE=DATA,COLOR=RGB(170 86 136),MACRO=COND0002,$ TYPE=DATA,COLOR=RGB(191 0 66),MACRO=COND0003,$ TYPE=DATA,COLOR=RGB(40 0 191),MACRO=COND0004,$ *GRAPH_SCRIPT setReportParsingErrors(false); setSelectionEnableMove(false); setDisplay(getY1Title(),false); setDisplay(getO1Title(),false); setDisplay(getY1MajorGrid(),false); setFillColor(getChartBackground(),new Color(255,255,255)); setFillColor(getFrame(),new Color(255,255,255)); setDisplay(getO1MajorGrid(),false); setDataTextDisplay(false); setTransparentBorderColor(getChartBackground(),true); setStackedDataValueSum(false); *END ENDSTYLE END
Thanks in advanceThis message has been edited. Last edited by: Tamra,
ENGINE INT CACHE SET ON
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='400.0';
-DEFAULTH &WF_STYLE_WIDTH='600.0';
-DEFAULTH &WF_TITLE='WebFOCUS Report';
GRAPH FILE CAR
SUM CAR.BODY.SEATS
BY CAR.COMP.CAR
ACROSS CAR.ORIGIN.COUNTRY
WHERE CAR.ORIGIN.COUNTRY EQ 'W GERMANY' OR 'JAPAN';
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT 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 GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 1
ON GRAPH SET LOOKGRAPH VBRSTK1
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/javaassist/intl/EN/ENIADefault_combine.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setDisplay(getY1Title(),false);
setDisplay(getO1Title(),false);
setDisplay(getY1MajorGrid(),false);
setFillColor(getChartBackground(),new Color(255,255,255));
setFillColor(getFrame(),new Color(255,255,255));
setDisplay(getO1MajorGrid(),false);
setDataTextDisplay(false);
setTransparentBorderColor(getChartBackground(),true);
setStackedDataValueSum(false);
setFillColor(getSeries(0),new Color(28, 145, 108));
setFillColor(getSeries(1),new Color(170, 86, 136));
setFillColor(getSeries(2),new Color(191, 0, 66));
setFillColor(getSeries(3),new Color(40, 0 ,191));
*END
ENDSTYLE
END
-RUN
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013
The addition of the stylesheet macro commands would work for a PIE chart. This is probably because the slice is a different series. For the bar, each bar is a different group in the same series. A pie chart is always a different color be default whereas, the bar chart can be all the same color.
At this point in time the legend does not check the conditional styling.
I've seen where colors are set up using defines and then passed to the SetFillColor calls to get the legend to line up. Similar to the suggestion made by MartinY.
There is an ongoing project in the product division referred to as 'color binding' that is in-line with your idea. We have no estimated time of implementation on this functionality.
You can find more information on the SetFillColor on the Technical Support Center - click on the Search Technical Content under the heading "Get Answers Now'
Here you can add in search criteria for your version. I entered 'SetFillColor' - as in MartinY's example.