http://jsfiddle.net/r6p7E/6/을 선택하면 선택할 때마다 같은 색상으로 선택된 섹션이 표시됩니다. 나는 이것을 클릭 할 때만 노란색으로하고 싶다.부품을 하이 컬러로 표시 할 때이 부품을 클릭했을 때
코드 : http://jsfiddle.net/L5SXX/
당신은 allowPointSelect 켜고 다음 선택 상태에 대한 색상을 추가해야
$(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