Focal Point
[NFR OPENED] GRAPH tooltip text formatting

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3817007336

September 24, 2013, 04:51 AM
Wep5622
[NFR OPENED] GRAPH tooltip text formatting
We have some graphs where the tooltip information as it is formatted by default gets really confusing. The tooltip puts data related to the data-point one axis after another, separated by spaces. Since we tend to use space for thousands separators as well, it's often unclear whether a space is an axis separator or a thousands separator, leading to users drawing wrong conclusions about either the correctness of our graphs or about the contents of the graph.

For example, we have a graph showing sales (Y1 axis) per month (Ordinal axis) per product range (Legend), which can result in a value: "AA 3 456 789". That value means that we sold 456,789 items of AA in March, but one could just as well read that tooltip to read we sold 3,456,789 items of AA in the month that the position on the ordinal axis corresponds to (in this case, March). We don't want people to throw parties over wrong information!

We'd much prefer that tooltip to read something like "AA: 3; 456 789", for example, where the legend-item is separated from the data-point value using a colon (':') and the data value coordinates are separated using a semi-colon(';') or a comma (',').

Is something like that possible? If so, how to achieve that?

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


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
September 25, 2013, 10:00 AM
dbeagan
You could insert line feed characters.
DEFINE FILE GGSALES
REGION/A13 = REGION | '\n';
END
GRAPH FILE GGSALES
SUM UNITS AS 'Units Sold\n'
BY REGION
END
  



WebFOCUS 8.2.06
November 07, 2013, 12:10 PM
Francis Mariani
This is a decent solution, but has anyone figured out how to style the tooltip as Wep5622 asked?

It seems setUserToolTip might do the job...

Thanks,


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
November 07, 2013, 01:49 PM
Francis Mariani
Oh well.

How to change the Tooltip background color change outlines how to change the tooltip format, background colour etc. Unfortunately, GRAPHEDIT must be set to OFF to enable this, though there is no explanation why. Version 8 apparently does not have this restriction, so I'll have to wait at least a year before attempting this again.


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
November 20, 2013, 05:18 AM
Wep5622
I've been experimenting a bit and it appears neither solution will be 100% satisfying.

Following dbeagan's solution with my initial example, we would end up with axis labels with undesirable characters in them, such as ': ' and '; '.
His suggested newline character seems a reasonable alternative to at least separate the field values such that they are not ambiguous to the user. Those newlines do not appear to have impact on the displayed legend (where those same labels are printed). I consider that a reasonable workaround at this moment.

Francis' suggestion is much more customisable with respect to the tooltips and that really got my hopes up! Unfortunately, it requires GRAPHEDIT=OFF, which results in the graphs being rendered as a browser-side Java applet. That's a bit slow. It does work fairly well though.

Fun fact, when you attempt to use the GRAPHEDIT=OFF type graph and specify ON GRAPH PCHOLD FORMAT PNG, because that's what you'd normally do when creating a graph in HTML output, then the graph doesn't use the Java applet (and thus the tooltips aren't styled as specified). It makes sense that the graph can't be rendered as a Java applet when you specify something else, but a warning or an error would have been helpful!


Finally; I do not get why it's apparently so hard to customise the tooltip format. Why do I need to run a Java applet to do so?
It seems to me that it would suffice to make the TITLE-attributes in the HTML AREA tags customisable in a similar way as how HEADINGs can be formatted.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :