I'm adding an SVG-based graphic to my chart by way of chart.renderer.image()
as shown in this jsfiddle example:
$(function () {
$('#container').highcharts({
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}]
}, function (chart) { // on complete
chart.renderer.image('https://cloud3squared.com/files/example.svg', 100, 100, 70, 70)
.add();
});
});
In the original SVG file itself, I can change the fill colour of the graphic in the SVG with the following:
style="fill:#ffffff;fill-opacity:1"
That changes it from black to white. But I'd like to be able to set this colour dynamically, in the code. I've tried various ways without success. Any ideas?