i need another Highchart Legend which i want to style with css/html. I found a topic with this topic but I can't get it to work and the jsFiddle Link isn't working anymore...
Can someone help me to get this working? Please
Here is my jsfiddle Link http://jsfiddle.net/chogger/j3xvg
This is what I found:
$(chart.series).each(function(i, serie){
$('<li style="color: '+serie.color+'">'+serie.name+'</li>').click(function(){
serie.visible ? serie.hide() : serie.show();
}).appendTo('#legend')
})
What exactly doesn't work for you? Are you using load event handler for this? See: http://jsfiddle.net/j3xvg/1/
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
defaultSeriesType: 'line',
marginRight: 50,
marginBottom: 175,
events: {
load: function () {
var chart = this;
$(chart.series).each(function (i, serie) {
$('<li style="color: ' + serie.color + '">' + serie.name + '</li>').click(function () {
serie.visible ? serie.hide() : serie.show();
}).appendTo('#legend');
});
}
}
},
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With