In this question user asks how to use several colors in a heatLegend gradient.
This pen provides a way to do so. However, line 108 of the pen says "this needs to be repeated e.g. on window resize, orientation change, etc."
What would be the correct listener for this to happen? I tried to rebuild the gradient on "sizechanged" with
chart.events.on("sizechanged", function(ev) {
heatLegendTop.markers.each(function(marker, markerIndex) {
... same gradient stuff ...
})
but it still returns the 2-colored gradient on resize.
For anyone who comes across this question, here's an updated pen that does just that.
It essentially involves listening for the sizechanged
event on the heatLegend itself:
heatLegend.markers.template.events.on("sizechanged", function(event) {
event.target.fill = event.target.fill;
});