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] Custom legend to graph

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Custom legend to graph
 Login/Join
 
Master
posted
Hello

Below is a graph with CAR file.

I have similar graph and I am working to get a legend like this.
It should show 3 colors with text like "ITALY Amount", "JAPAN Amount", "W GERMANY Amount" beside each color.
Please suggest.

-SET &SEL1 = 'ITALY';
-SET &SEL2 = 'JAPAN';
-SET &SEL3 = 'W GERMANY';

GRAPH FILE CAR
SUM
SALES
BY COUNTRY AS '' NOPRINT
BY CAR AS ''
WHERE SALES GT 0;
WHERE COUNTRY EQ '&SEL1' OR '&SEL2' OR '&SEL3';
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET LOOKGRAPH VBAR2AX
ON GRAPH SET GRMERGE ON
ON GRAPH SET GRAPHSTYLE *
setTemplateFile("/images/tdg/template/IBISouthWestern.txt");
setLegendDisplay(true);
ENDSTYLE
ON GRAPH SET STYLE *
PAGESIZE='Letter',$
DEFMACRO=COND0001,MACTYPE=RULE,WHEN=COUNTRY EQ '&SEL1',$
DEFMACRO=COND0002,MACTYPE=RULE,WHEN=COUNTRY EQ '&SEL2',$
DEFMACRO=COND0003,MACTYPE=RULE,WHEN=COUNTRY EQ '&SEL3',$
TYPE=DATA,COLOR='RED',MACRO=COND0001,$
TYPE=DATA,COLOR='GREEN',MACRO=COND0002,$
TYPE=DATA,COLOR='YELLOW',MACRO=COND0003,$
ENDSTYLE
END

This message has been edited. Last edited by: <Kathryn Henning>,


8.1.05
HTML,PDF,EXL2K, Active, All
 
Posts: 484 | Registered: February 03, 2009Report This Post
Master
posted Hide Post
You may need to use ANNOTATIONS to get this.
 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Report This Post
Master
posted Hide Post
I never used ANNOTATIONS. Can you provide any example? I will search in forum as well.

Its not just text I am trying to display. It should be like legend with colored box beside each text.

quote:
Originally posted by Ram Prasad E:
You may need to use ANNOTATIONS to get this.

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


8.1.05
HTML,PDF,EXL2K, Active, All
 
Posts: 484 | Registered: February 03, 2009Report This Post
<nick z>
posted
Hi,
You could try something like this:


DEFINE FILE CAR
 MYCOUNTRY/A50=IF COUNTRY EQ 'ITALY' THEN 'ITALY Amount' ELSE IF COUNTRY EQ 'JAPAN' THEN 'JAPAN Amount' ELSE IF COUNTRY EQ 'W GERMANY' THEN 'W GERMANY Amount';
END
GRAPH FILE CAR
SUM CAR.BODY.SALES
BY MYCOUNTRY
ACROSS CAR.COMP.CAR
WHERE COUNTRY EQ 'ITALY' OR 'JAPAN' OR 'W GERMANY';
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET ARGRAPHENGIN JSCHART
ON GRAPH SET VZERO OFF
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 STYLE *
*GRAPH_SCRIPT

setPieDepth(0);
setPieTilt(0);
setDepthRadius(0); 
setCurveFitEquationDisplay(false); 
setPlace(true); 

*END
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setFillColor(getSeries(0), new Color(255,0,0));
setFillColor(getSeries(1), new Color(0,255,0));
setFillColor(getSeries(2), new Color(255,255,0));

*END
ENDSTYLE
END

-RUN

  


Thanks.
 
Report This Post
Master
posted Hide Post
quote:
Originally posted by nick z:
Hi,
You could try something like this:


DEFINE FILE CAR
 MYCOUNTRY/A50=IF COUNTRY EQ 'ITALY' THEN 'ITALY Amount' ELSE IF COUNTRY EQ 'JAPAN' THEN 'JAPAN Amount' ELSE IF COUNTRY EQ 'W GERMANY' THEN 'W GERMANY Amount';
END
GRAPH FILE CAR
SUM CAR.BODY.SALES
BY MYCOUNTRY
ACROSS CAR.COMP.CAR
WHERE COUNTRY EQ 'ITALY' OR 'JAPAN' OR 'W GERMANY';
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET ARGRAPHENGIN JSCHART
ON GRAPH SET VZERO OFF
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 STYLE *
*GRAPH_SCRIPT

setPieDepth(0);
setPieTilt(0);
setDepthRadius(0); 
setCurveFitEquationDisplay(false); 
setPlace(true); 

*END
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setFillColor(getSeries(0), new Color(255,0,0));
setFillColor(getSeries(1), new Color(0,255,0));
setFillColor(getSeries(2), new Color(255,255,0));

*END
ENDSTYLE
END

-RUN

  


Thanks.


thanks nick...this worked..
meanwhile I got it to work using compound pdf and displaying that legend using a dummy report but this is efficient.


8.1.05
HTML,PDF,EXL2K, Active, All
 
Posts: 484 | Registered: February 03, 2009Report 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] Custom legend to graph

Copyright © 1996-2020 Information Builders