0
Highcharts pie chart - offset a single slice on legend click回答了標題提出的問題,但我對此的問題。當你點擊一個傳說,對應的片彈出,當你點擊第二個,這也與第一個一起爆炸。Highcharts餅片偏移的傳奇點擊
我想在這裏做的是,只有點擊切片爆炸和其他所有片回到原來的位置,從而只能有一次一個選擇的切片。
在這方面的任何幫助將因爲我不是很熟悉highchart事件不勝感激..
$(function() {
$(document).ready(function() {
// Build the chart
$('#container').highcharts({
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
type: 'pie'
},
title: {
text: 'Browser market shares January, 2015 to May, 2015'
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: false
},
showInLegend: true,
point: {
events: {
legendItemClick: function() {
this.slice();
/*Something should happen here to move all other slices back*/
return false;
}
}
}
}
},
series: [{
name: "Brands",
colorByPoint: true,
data: [{
name: "Microsoft Internet Explorer",
y: 56.33
}, {
name: "Chrome",
y: 24.03,
sliced: true,
selected: true
}, {
name: "Firefox",
y: 10.38
}, {
name: "Safari",
y: 4.77
}, {
name: "Opera",
y: 0.91
}, {
name: "Proprietary or Undetectable",
y: 0.2
}]
}]
});
});
});