Focal Point
[Case Closed] Custom Tooltip for a Map Graph with Lat/Long

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

February 21, 2017, 03:28 PM
WF1326
[Case Closed] Custom Tooltip for a Map Graph with Lat/Long
I am trying to add a custom tooltip to the map code below.

The tooltip that i would like to achieve is:

Line Price: data value
Latitude: lat value
Longitude: lng value

I was using the following documentation
http://documentation.informati...t/source/topic26.htm

Inside the documentation, for the function parameter 'd' description there are Data Modes for maps that we can access to get the lat/lng info.

Any ideas on how i can access those values and add to my tootip return expression?

Sample Code:
JOIN
POSTALCODE IN centurysales TO MULTIPLE
POSTALCODE IN locale
END


GRAPH FILE centurysales
SUM LINEPRICE
BY LATITUDE
BY LONGITUDE
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET UNITS PIXELS
ON GRAPH SET HAXIS 700
ON GRAPH SET VAXIS 400
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 2
ON GRAPH SET LOOKGRAPH BUBBLEMAP
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);
setPlace(true); setToolTipStyle("html5");
*END
INCLUDE=endeflt.sty,$
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setDisplay(getLegendArea(),true);
*GRAPH_JS
"mapProperties": {
"leaflet": {
"overlayLayers": [{
"layerInfo": {
"type": "regions"
},
"title": "United States of America",
"type": "latlng",
"url": function(){ return tdgchart.getScriptPath() + 'map/US.json'}
}],
"baselayers": [{
"layerInfo": {
"maxZoom": 16,
"attribution": function() { return "&|copy; Information Builders | " +
"Map Tiles: &|copy; Esri"; }
},
"title": "ArcGIS_World_Street_Map",
"url": function() { return 'http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}'; }
}]
}
},
series: [
{'series': 0,
tooltip: function(d,s,g){
return 'Line Price: ' + d + '
Latitude: ' + d.lat + '
longitude: ' + d.lng ; }
}]
*END
ENDSTYLE
END
-RUN

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


WebFOCUS
7703/7705/8105m/8201m/8202m

February 23, 2017, 05:32 PM
Kathleen Butler
Hi WF1326,

I see that you have a case open and they are working on finding a resolution.

Please update the post once you have a resolution from Customer Support. Thanks so much.

Sincerely,

Kathleen Butler
Customer Care & Communications Manager
Information Builders
March 06, 2017, 01:12 PM
WF1326
Got a reply from Tech Support. Below code worked for me.

series: [ {'series': 0, tooltip: function(d,s,g, data){ return 'Line Price: ' + d + '[/br]Latitude: ' + data.lat + '[/br]longitude: ' + data.lng ; } }]


WebFOCUS
7703/7705/8105m/8201m/8202m