Pie hide issues
author(s): Torstein Hønsi
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<div id="container" style="height: 400px; width: 500"></div>
JavaScript
$(function() {
var chart = window.chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'pie'
},
plotOptions: {
pie: {
showInLegend: true,
point: {
events: {
legendItemClick: function () {
if (this.visible === true) {
this._y = this.y;
this.setVisible(false);
this.update(0, false);
}
else {
this.update(this._y);
this.setVisible(true);
}
// prevent default behaviour
return false;
}
}
}
}
},
series: [{
data: [
{
name: 'Firefox',
y: 44.2,
trueVal: 44.2},
['IE7', 26.6],
['IE6', 20],
['Chrome', 3.1],
{
name: 'Other',
y: 5.4
}
]}]
});
});