I am trying to create a heatmap from some static data. The data has x,y coordinates with the value at the data point. The value is associate with a URL and i Want to make it clickable event so when clicked on the heatmap point it will redirect to that URL.
the data is like,
data=
[{point:[0,0],value:1,url:'http://www.google.com'},
{point:[0,1],value:2,url:'http://www.yahoo.com'},
{point:[1,0],value:5,url:'http://www.apple.com'},
{point:[1,1],value:10,url:'http://www.netflix.com'}]
I am using heatmap.js to plot the heatmap.I can use any other heatmap library if i can produce the required answer.
Thanks in advance.
Using your data and heatmap library here is quick example.
http://jsfiddle.net/mjaric/3ELmM/
It has drawbacks, like memory usage and depends how much data you have in data array. But for sake of simplicity I used closure to bound local vars to click event. It’s much clearer then to write memory lighter solution.