ハイチャートを初めて使用しています。それは涼しくて、私が欲しいものをほとんどやっている。私はpiechartを使用し、毎秒データをリフレッシュします。それは作品の色だけが毎秒変化している作業です。どのように私は同じ色を保つことができますか?ハイチャートで同じ色を維持する方法
は、これは私のコード
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
plotBackgroundColor: null,
animation: false,
plotBorderWidth: null,
plotShadow: false,
events: {
load: function() {
// set up the updating of the chart each second
var series = this.series[0];
setInterval(function() {
$.getJSON("opencont.php", function (data) {
$.each(data.vragen, function (index, value) {
series.addPoint([value.short, value.antwoorden], true, true);
})
})
}, 1000);
}
}
},
title: {
text: ''
},
tooltip: {
formatter: function() {
return '<b>'+ this.point.name +'</b>: '+ this.percentage +' %';
}
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
color: '#000000',
connectorColor: '#000000',
formatter: function() {
return '<b>'+ this.point.name +'</b>: '+ this.percentage +' %';
}
}
}
},
series: [{
type: 'pie',
name: 'Browser share',
data: [
['a', 0], ['b', 0], ['c', 0]
]
}]
});
});
でそれがここで回答されていますhttp://stackoverflow.com/questions/17802509/how-can-i-reset-the-styles-given-to-series-in-highcharts – Aximili