Focal Point
[CLOSED] Dynamic Title on Multiple Maps

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

October 11, 2019, 01:35 PM
Steven L Carter
[CLOSED] Dynamic Title on Multiple Maps
My fex generates multiple maps.

GRAPH FILE DATA_TABLE

SUM STD_COUNT AS '# of Students'
BY COMBO_NAME AS 'Map Title'
BY ZIP3 AS 'First Three Digits of ZIP Code'

ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET GRWIDTH 1
ON GRAPH SET LOOKGRAPH CHOROPLETH
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *

TYPE=DATA, COLUMN=COMBO_NAME, BUCKET=page, $
TYPE=DATA, COLUMN=ZIP3, BUCKET=location, $
TYPE=DATA, COLUMN=STD_COUNT, BUCKET=color, $

*GRAPH_JS_FINAL
"title":{"visible": true, "text": "SHOULD HAVE VALUE OF COMBO_NAME HERE"},
"mapProperties": {
    "leaflet": {
	"initPos": {
		"center": [35.3, -80.7],
		"level": 6
		},
    "baselayers":             [
            {
                "layerInfo": {
                    "maxZoom": 16,
                    "attribution": function() {  return "&|copy; <a target='_blank' href='http://www.InformationBuilders.com'>Information Builders</a> | " + "Map Tiles: &|copy; Esri"; }
                },
                "title": "ArcGIS_World_Street_Map",
                "url": function(){return "http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}"; }
            }
        ],
    "overlayLayers":             [
            {
                "dataLookup": "properties.zcta3",
                "layerInfo": {
                    "type": "regions"
                },
                "type": "tdg",
                "title": "Student Location by First Three Digits of ZIP Code",
                "url": function() {  return tdgchart.getScriptPath() + 'map/uszip3state.json' }
            }
        ]
    }
},

...

"agnosticSettings": {
    "chartTypeFullName": "Choropleth"
}
*END
ENDSTYLE
END
  


The problem is that I need a different title above each map, but the same static title on each is all I've been able to do. I'm pretty sure that "SHOULD HAVE VALUE OF COMBO_NAME HERE" should be replaced with a callback function, but nothing I tried worked. Anyone have a suggestion?

STEVE

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8207
Excel, PDF, HTML
October 14, 2019, 06:51 PM
Doug
Have you tried to use a DM Var?

Change: "SHOULD HAVE VALUE OF COMBO_NAME HERE"
To: 'WF_TITLE.EVAL'
Or, plagiarize IA Code.
Ref: From a chart created in IA.
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $

October 15, 2019, 02:45 PM
Steven L Carter
I don't see how that could work. The fex makes multiple maps. There is a separate map for each COMBO_NAME and COMBO_NAME is that map's title. I would need to set WF_TITLE's value before the fex starts, right? How could WF_TITLE's value change as the fex runs?


WebFOCUS 8207
Excel, PDF, HTML
October 15, 2019, 02:50 PM
Steven L Carter
I did try to create a series of single maps by looping through the fex once for each value of COMBO_NAME. The problem is that it created each map in the same window, each one replacing the previous ones, so that I only wound up with one map. If there was some way to open a new browser window each time the fex ran or append each map at the bottom of the previous, that might work. Anyone know how to do that?


WebFOCUS 8207
Excel, PDF, HTML
October 15, 2019, 10:55 PM
Doug
What is the final display format? You can do it in a portal if portals are an acceptable option for viewing the output.

Or, possibly a 'compound document'?

I guess what I'm saying is that we need more information on the actual requirements.
October 16, 2019, 09:36 AM
Steven L Carter
I was just shooting for HTML output, but I'm open to alternatives. A compound document would be OK I guess. I hadn't tried that. My portal options are limited as my portal is public.


WebFOCUS 8207
Excel, PDF, HTML
October 16, 2019, 12:50 PM
Doug
quote:
My portal options are limited as my portal is public.
Public Portals are OK IF you have the proper security set-up on them.
HTML (HTMLFORM BEGIN/END) should always work. That's one of my "Plan Bs".