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     [closed] Manual Legend - Graph

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[closed] Manual Legend - Graph
 Login/Join
 
Master
posted
Hello

I have a customized bar graph with colors based on year.

Is there a way to manually display legend with customizations to text, marker type etc.?
I used below code but no legend is displayed
setFontName(getLegendText(),"SansSerif");
setFontSizeAbsolute(getLegendText(),true);
setFontSizeInPoints(getLegendText(),10);
setPlaceResize(getLegendText(),0);
setFontStyle(getLegendText(),2);
setLegendSeriesStart(1);
setTextString(getLegendLabel(0),"2015");
setDisplay(getLegendLabel(0),true);
setTextString(getLegendLabel(1),"2014");
setDisplay(getLegendLabel(1),true);
setTextString(getLegendLabel(2),"2013");
setDisplay(getLegendLabel(2),true);
setTextString(getLegendLabel(3),"2012");
setDisplay(getLegendLabel(3),true);
setMarkerShape(getLegendLabelMarker(0),1);
setMarkerShape(getLegendLabelMarker(1),1);
setMarkerShape(getLegendLabelMarker(2),1);
setMarkerShape(getLegendLabelMarker(3),1);
setFillColor(getLegendLabelMarker(0),new Color(115,115,115));
setFillColor(getLegendLabelMarker(1),new Color(243,93,19));
setFillColor(getLegendLabelMarker(2),new Color(130,184,201));
setFillColor(getLegendLabelMarker(3),new Color(168 182 124));


Please suggest.

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
Expert
posted Hide Post
You may need to include one or both of these as well:

setLegendAutomatic(false);             // Turn off legend automatic setting
setLegendDisplay(true);                // Turn onlegend


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Master
posted Hide Post
quote:
Originally posted by Francis Mariani:
You may need to include one or both of these as well:

setLegendAutomatic(false);             // Turn off legend automatic setting
setLegendDisplay(true);                // Turn onlegend


Franics

It tried but it doesn't work. Below is the graph code. I have all legend code at the end.
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HAXIS 900
ON GRAPH SET VAXIS 600
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET GRMERGE ON
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);
setTransparentBorderColor(getChartBackground(),true);
setTransparentBorderColor(getAllSeries(),true);
setPlace(true);
setDepthRadius(0);
setDepthAngle(0);
setTransparentBorderColor(getFrame(),true);
setTransparentFillColor(getFrame(),true);
setDisplay(getDataText(),true);
setFontSizeAbsolute(getDataText(),true);
setFontSizeInPoints(getDataText(),10);
setPlaceResize(getDataText(),0);


setConnectLineMarkers(true);
setMarkerDisplay(false);


-* START COLORS
-REPEAT :YR1 FOR &SRS1 FROM 0 TO 11 STEP 1
setFontSizeAbsolute(getLegendText(), true);
setFontSizeInPoints(getLegendText(), 10);
setPlaceResize(getLegendText(), 0);
setFontStyle(getLegendText(),2);
setFillColor(getSeries(&SRS1),new Color(70,70,70));
-:YR1
-REPEAT :YR2 FOR &SRS2 FROM 12 TO 23 STEP 1
setFillColor(getSeries(&SRS2),new Color(248,93,19));
-:YR2
-SET &LUPEND = 23 + &CURRMO;
-REPEAT :YR3 FOR &SRS3 FROM 24 TO &LUPEND STEP 1
setFillColor(getSeries(&SRS3),new Color(130,184,201));
-:YR3
-SET &AVGBAR = &LUPEND+1;
-SET &AVGBARZ=&LUPEND+2;
-REPEAT :AVGS FOR &AV FROM &AVGBAR TO &AVGBARZ STEP 1
setFillColor(getSeries(&AV),new Color(168,182,124));
-:AVGS
-*-END COLORS


-* LEGEND CODE

setLegendAutomatic(false);
setLegendDisplay(true);
setFontName(getLegendText(),"SansSerif");
setFontSizeAbsolute(getLegendText(),true);
setFontSizeInPoints(getLegendText(),10);
setPlaceResize(getLegendText(),0);
setFontStyle(getLegendText(),2);
-*setLegendSeriesStart(1);
setTextString(getLegendLabel(0),"2015");
setDisplay(getLegendLabel(0),true);
setTextString(getLegendLabel(1),"2014");
setDisplay(getLegendLabel(1),true);
setTextString(getLegendLabel(2),"2013");
setDisplay(getLegendLabel(2),true);
setTextString(getLegendLabel(3),"2012");
setDisplay(getLegendLabel(3),true);
setMarkerShape(getLegendLabelMarker(0),1);
setMarkerShape(getLegendLabelMarker(1),1);
setMarkerShape(getLegendLabelMarker(2),1);
setMarkerShape(getLegendLabelMarker(3),1);
setFillColor(getLegendLabelMarker(0),new Color(70,70,70));
setFillColor(getLegendLabelMarker(1),new Color(248,93,19));
setFillColor(getLegendLabelMarker(2),new Color(130,184,201));
setFillColor(getLegendLabelMarker(3),new Color(168 182 124));

ENDSTYLE

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
Expert
posted Hide Post
Us developers (not users) like having some reproducible code to play with.

I've created a program that anyone with the CAR file can run. I've left your graph style pretty much intact. The code does produce a graph with the legend.

GRAPH FILE CAR
SUM 
LENGTH
WIDTH
HEIGHT

WHEELBASE
FUEL_CAP
BHP

MPG
ACCEL

ACROSS BODYTYPE

ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HAXIS 900
ON GRAPH SET VAXIS 600
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET GRMERGE ON
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);
setTransparentBorderColor(getChartBackground(),true);
setTransparentBorderColor(getAllSeries(),true);
setPlace(true);
setDepthRadius(0);
setDepthAngle(0);
setTransparentBorderColor(getFrame(),true);
setTransparentFillColor(getFrame(),true);
setDisplay(getDataText(),true);
setFontSizeAbsolute(getDataText(),true);
setFontSizeInPoints(getDataText(),10);
setPlaceResize(getDataText(),0);

setConnectLineMarkers(true);
setMarkerDisplay(false);

-* START COLORS
setFontSizeAbsolute(getLegendText(), true);
setFontSizeInPoints(getLegendText(), 10);
setPlaceResize(getLegendText(), 0);
setFontStyle(getLegendText(),2);

-REPEAT :YR1 FOR &SRS1 FROM 0 TO 2 STEP 1
setFillColor(getSeries(&SRS1),new Color(70,70,70));
-:YR1

-REPEAT :YR2 FOR &SRS2 FROM 3 TO 5 STEP 1
setFillColor(getSeries(&SRS2),new Color(248,93,19));
-:YR2

-*-SET &LUPEND = 23 + &CURRMO;
-SET &LUPEND = 6;
-REPEAT :YR3 FOR &SRS3 FROM 6 TO &LUPEND STEP 1
setFillColor(getSeries(&SRS3),new Color(130,184,201));
-:YR3

-SET &AVGBAR = &LUPEND+1;
-SET &AVGBARZ=&LUPEND+2;
-REPEAT :AVGS FOR &AV FROM &AVGBAR TO &AVGBARZ STEP 1
setFillColor(getSeries(&AV),new Color(168,182,124));
-:AVGS
-* END COLORS


-* LEGEND CODE

setFontName(getLegendText(),"SansSerif");
setPlaceResize(getLegendText(),0);
setFontSizeAbsolute(getLegendText(), true);
setFontSizeInPoints(getLegendText(), 10);

setFontStyle(getLegendText(),2);
setLegendSeriesStart(1);
setTextString(getLegendLabel(0),"2015");
setDisplay(getLegendLabel(0),true);
setTextString(getLegendLabel(1),"2014");
setDisplay(getLegendLabel(1),true);
setTextString(getLegendLabel(2),"2013");
setDisplay(getLegendLabel(2),true);
setTextString(getLegendLabel(3),"2012");
setDisplay(getLegendLabel(3),true);
setMarkerShape(getLegendLabelMarker(0),1);
setMarkerShape(getLegendLabelMarker(1),1);
setMarkerShape(getLegendLabelMarker(2),1);
setMarkerShape(getLegendLabelMarker(3),1);
setFillColor(getLegendLabelMarker(0),new Color(70,70,70));
setFillColor(getLegendLabelMarker(1),new Color(248,93,19));
setFillColor(getLegendLabelMarker(2),new Color(130,184,201));
setFillColor(getLegendLabelMarker(3),new Color(168 182 124));
ENDSTYLE
END



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
You may need to view the source of your graph to see if any error/warning messages were generated.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report 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     [closed] Manual Legend - Graph

Copyright © 1996-2020 Information Builders