我如何修改此代码http://jsfiddle.net/r6p7E/6/以查看每次我选择时使用相同颜色选择的部分?只有当我点击这个时,我才想让它变成黄色。Highcharts当我点击此部分时的部分馅饼颜色
代码:
$(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();
}
);
});
你是说你不想要的颜色变化,当你徘徊,只有你希望它在点击时改变?另外,当你点击时你是否想要所有的作品都是相同的颜色(黄色),还是你希望每个作品都是自己的颜色? –
我希望我点击的部分是黄色的,而其他人不会改变。 – OOOO