For any support or more customized script, contact us -  binextlevel@gmail.com

Add additional information to tooltip - Area map

By default, in Area Map, tooltip shows limited information like name of country/state and one calculated value. Below script allow us to add more information to tooltip.




widget.on("beforequery", function (se, ev) {
	
	var newJaql = {
		jaql  : {
				//agg:'max', //enable this if you need to display aggreated value
				column: "Region", //Colum name
				datatype: "text",
				dim: "[Records.Region]", //table + column name
				table: "Records", //table name
				title: "Region"
		}
	}
	ev.query.metadata.push(newJaql)
	lastIndex = ev.query.metadata.length - 1	
})

widget.on("render", function (se, args){
	$.each(args.widget.queryResult.$$rows, function(index, value){
		value[1].text = value[1].text + ', Region: ' + value[2].text //replace 'Region' with label you want
	
	})
})



50 views0 comments

Recent Posts

See All