我正在使用highcharts製作一個餅圖,但我無法加載自定義顏色集爲我的圖表。如何更改我的高圖餅圖的顏色?
這裏是我的代碼:
<script type="text/javascript">
$(function() {
Highcharts.setOptions({
colors: ['#50B432', '#ED561B', '#DDDF00', '#24CBE5', '#64E572', '#FF9655', '#FFF263', '#6AF9C4']
});
return new Highcharts.Chart({
chart: {
renderTo: 'trailpiechart',
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
backgroundColor: "#f8f8f8",
margin: [20, 20, 20, 20]
},
credits: {
enabled: false
},
title: {
text: caption
},
tooltip: {
formatter: function() {
return this.y + ' links';
}
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: false
},
showInLegend: true
}
},
legend: {
layout: 'vertical',
floating: false,
borderRadius: 0,
borderWidth: 0
},
series: [{
type: 'pie',
name: 'Browser share',
data: data
}]
});
});
</script>
我的餅圖可與此代碼,但它僅使用默認的調色板。
如何指定自定義顏色集?
我試過這個,但是,我的傳奇色彩正在改變,但餅圖顏色並沒有改變。 – Rohitesh 2017-09-08 10:14:13