Focal Point
[CLOSED]WF8 - HTML5 Charts - Lines With Same Coordinates - Match Line Drawn?

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

May 19, 2016, 12:39 PM
David Briars
[CLOSED]WF8 - HTML5 Charts - Lines With Same Coordinates - Match Line Drawn?
-* Create data extract.
TABLE FILE GGSALES
SUM 
 COMPUTE LEVEL1/I9 = 0;
 COMPUTE LEVEL2/I9 = 0;
 COMPUTE LEVEL3/I9 = 10;
BY ST
ON TABLE HOLD
END
-RUN
-* Create visualization.
GRAPH FILE HOLD
 SUM LEVEL1
     LEVEL2
	 LEVEL3
-*
 BY  ST
-*
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 1
ON GRAPH SET LOOKGRAPH VLINE
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
-*
*GRAPH_JS 
 htmlToolTip: {enabled: true, snap: false, sticky: false, style: {borderStyle: 'solid', borderColor: 'rgb(130, 130, 130)', background: 'white'}
              }
*END
-* Create the tool tip box content.
*GRAPH_JS
 "series": [
 {series: 'reset', tooltip: function(d, s, g) {
  return ' '
   + 'Series #: ' + s + '<br>'
   + 'Series Label: ' + this.getSeries(s).label + '<br>'
   + 'Group: ' + g + '<br>'
   + 'State: ' +  this.getGroupLabel(g).replace(/> /g, ':') + '<br>'
   + 'Value: ' + this.formatNumber(d, '#') +'</b>';
 }},
          ]
*END
-*
ENDSTYLE
END  


Run this code and you should see that each of the first two series has the same coordinates, and therefore each line is 'drawn one on top of the other'.

The line and markers are green, implying that the line is for the 2nd series, 'LEVEL2'.

The tooltip, however, shows information for the 1st series, 'LEVEL1'.

How can I amend the tooltip so that it show both series - 'LEVEL1' and 'LEVEL2'?

(Guessing: Loop through the series and accumulate the series labels?)

This message has been edited. Last edited by: <Emily McAllister>,




Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
May 25, 2016, 06:42 PM
<Emily McAllister>
Hi David,
As far as I know, there isn't a way to control which of the lines is "on top" or which tooltip displays when there are conflicting ones. That being said, since the data point is by necessity the same value for each, I don't see this being much of an issue for people. After all, the tooltip is not incorrect, just slightly different from what is being displayed.

If this is a real issue for you, I would open a case for this, but I can't think of any times when this would be a problem for an end-user.

Emily McAllister
Focal Point Moderator