我如何修改此代码http://jsfiddle.net/r6p7E/6/以在每次选择时查看以相同颜色选择的部分?只有当我单击它时,我才希望它是黄色的。
代码 :
$(function () {
Highcharts.theme = {
colors: ['#242c4a'],
chart: {
width: 350,
backgroundColor: {
linearGradient: [0, 0, 500, 500],
stops: [
[0, 'rgb(255, 255, 255)'],
[1, 'rgb(240, 240, 255)']
]
},
},
};
// Apply the theme
Highcharts.setOptions(Highcharts.theme);
// Build the chart
$('#container').highcharts({
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false
},
title: {
text: 'Our Projects'
},
plotOptions: {
pie: {
borderColor: '#48588c',
borderWidth: 7,
slicedOffset: 10,
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: false
}
},
series: {
point: {
events: {
select: function() {
}
}
}
}
},
series: [{
type: 'pie',
name: 'Browser share',
dashStyle: 'LongDashDotDot',
data: [
['Firefox', 45.0],
['IE', 26.8],
{
name: 'Chrome',
y: 12.8,
sliced: true,
selected: true
},
['Safari', 8.5],
['Opera', 6.2],
['Others', 0.7]
]
}]
},
function(chart) { // on complete
var renderer = new Highcharts.Renderer(
$('#container')[0], 50, 50);
chart.renderer.circle(175, 216, 22).attr({
fill: '#e7e620',
'stroke-width': 5,
zIndex: 3
}).add();
}
);
});