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     How to change the LegendText in Graph

Read-Only Read-Only Topic
Go
Search
Notify
Tools
How to change the LegendText in Graph
 Login/Join
 
Master
posted
Is there any method we have to change the legendText in Graph?

Like how we can change the Y1axis label or O1Label. I want to change the text for Legend.

Thanks in advance,


WFConsultant

WF 8105M on Win7/Tomcat
 
Posts: 780 | Location: Florida | Registered: January 09, 2005Report This Post
Expert
posted Hide Post
Wouldn't this do it?

setFontName(getO1Label(),"Arial Narrow");
setFontSize(getO1Label(),10);
setFontSizeAbsolute(getO1Label(),true);

setFontName(getY1Label(),"Arial Narrow");
setFontSize(getY1Label(),10);
setFontSizeAbsolute(getY1Label(),true);

Can't recall what the setFontSizeAbsolute is for, may not need it.


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
That works but for me I want to change the LegendText.

Ex:

GRAPH FILE CAR
SUM DEALER_COST
BY CAR
ACROSS COUNTRY
END

The above code will show the legends as Country:BMW Country:Jaguar......

I want to remove Country in that. I can use setSeriesLabel("test") but I dont know how I can set this value based on BY field.

Hope I mentioned my problem clearly,


WFConsultant

WF 8105M on Win7/Tomcat
 
Posts: 780 | Location: Florida | Registered: January 09, 2005Report This Post
Guru
posted Hide Post
Try something like this:
 
setSeriesLabel(0,"Sunday");
setSeriesLabel(1,"Monday");
setSeriesLabel(2,"Tuesday");
setSeriesLabel(3,"Wednesday");
setSeriesLabel(4,"Thursday");
setSeriesLabel(5,"Friday");
setSeriesLabel(6,"Saturday");


(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
 
Posts: 391 | Location: California | Registered: April 14, 2003Report This Post
Master
posted Hide Post
setSeriesLabel will work for me but I dont know the text as I'm generating dynamic graph based on the selections in Front-end.

If we have any direct method then I can use, otherwise I have to save the across value and Read it in the graph properties and assign that read value in the setSeriesLabel. That's the solution I'm thinking.

Any other thoughts


WFConsultant

WF 8105M on Win7/Tomcat
 
Posts: 780 | Location: Florida | Registered: January 09, 2005Report This Post
Expert
posted Hide Post
I am confused about what your requirements are.

You mentioned "legend", but I don't think you're trying to affect the legend. Are you trying to change the text displayed in the "pop-up" (or "title text") when the cursor is moved over a graph element? Do you want to remove the name of the measure that's being graphed, but leave the name of the dimension and the measure value?

For example, if the pop-up displays as "SALES ENGLAND 12,000", do you want it to say "ENGLAND 12,000"? Here's a quick way to achieve that:
GRAPH FILE CAR
SUM
SALES AS ' '
BY COUNTRY AS 'COUNTRY'
END
Note the space character in SALES AS ' '.

If this is not want you want to do, then I apologise.


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
Hi Francis,
I'm trying to change the text in Legend only. When I use setSeriesLabel, it modified that and as you said it modifies the pop-up text also. My requirement is to change the text in Legend.

Hope it's clear for you now. Still I'm confusing you, I apologise


WFConsultant

WF 8105M on Win7/Tomcat
 
Posts: 780 | Location: Florida | Registered: January 09, 2005Report This Post
Expert
posted Hide Post
Kamesh,

When you use setSeriesLabel(n, "Text") the Legend will take up these values automatically. Or are you saying that you ONLY want the Legend text changed? If so then I think you may have hit a wall in as much that the Legend text is inferred from the series labels and no method or property, that I can see, will allow you to change the Legend text separately.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Master
posted Hide Post
Thanks Tony and Francis. I got it worked by saving the values in a table. Then read those values and assign it in setSeriesLabel. That works for me.


WFConsultant

WF 8105M on Win7/Tomcat
 
Posts: 780 | Location: Florida | Registered: January 09, 2005Report This Post
Expert
posted Hide Post
Kamesh,

If you want to reduce the I/O (very slightly Wink) then instead of having to SAVE and READ the values, you could output then text setSeriesLabel(n, "text"); in your TABLE request -

TABLE FILE CAR
PRINT COMPUTE Sequence/I2 = IF CAR EQ LAST CAR THEN LAST Sequence ELSE LAST Sequence + 1; NOPRINT
      COMPUTE SeriesLabel/A200 =  'setSeriesLabel('|EDIT(Sequence)|',"'|CAR|'");';
BY CAR NOPRINT
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE AS S_Labels
END
-RUN

And then just -INCLUDE S_Labels in your graph style code. You'll have to FILEDEF the S_Labels.fex file first of course!

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Master
posted Hide Post
Thanks Tony. Let me try that.


WFConsultant

WF 8105M on Win7/Tomcat
 
Posts: 780 | Location: Florida | Registered: January 09, 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     How to change the LegendText in Graph

Copyright © 1996-2020 Information Builders