ElementStacks
HTML
<script src="http://highcharts.com/js/testing.js"></script>
<div id="container" style="height: 300px"></div>
<script src="http://code.highcharts.com/master/highcharts.src.js"></script>
<script src="https://raw.github.com/danro/jquery-easing/master/jquery.easing.min.js"></script>
JavaScript
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container'
// events: {load: function(){console.log(this)} } debugging feature
},
plotOptions: {
series: {
events: {
legendItemClick: function (event) {
var thisSeriesName = this.name;
var thisSeriesVisibility = this.visible ? true : false;
$(chart.series).each(function (i, e) {
if (thisSeriesName === e.name) {
thisSeriesVisibility ? e.hide() : e.show();
}
});
event.preventDefault();
}
}
}
},
series: [{
type: 'spline',
showInLegend: false,
color: 'red',
name: 'first',
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]
}, {
data: [null],
name: 'first',
type: 'scatter',
color: 'yellow',
marker: {
symbol: 'triangle'
}
}]
});