當我點添加到我的一系列柱形圖動畫看起來可怕,新列只是出現在右邊,然後一切在多張幻燈片,以適應他們。例如:http://jsfiddle.net/jamesredwood/a0p4pqe8/與series.addPoint動畫效果Highcharts列()
如果新數據可以添加到視圖中,並且在同時其他所有內容都會移動的同時滑入視圖,則會更好。
有什麼辦法可以達到這個目的嗎?
Highcharts.chart('container', {
chart: {
type: 'column',
margin: [70, 50, 60, 80],
events: {
click: function (e) {
// find the clicked values and the series
var x = Math.round(e.xAxis[0].value),
y = Math.round(e.yAxis[0].value),
series = this.series[0];
// Add it
series.addPoint([x, y]);
}
}
},
title: {
text: 'User supplied data'
},
subtitle: {
text: 'Click the plot area to add a point. Click a point to remove it.'
},
xAxis: {
gridLineWidth: 1,
minPadding: 0.2,
maxPadding: 0.2,
maxZoom: 60
},
yAxis: {
title: {
text: 'Value'
},
minPadding: 0.2,
maxPadding: 0.2,
maxZoom: 60,
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
legend: {
enabled: false
},
exporting: {
enabled: false
},
plotOptions: {
series: {
lineWidth: 1,
point: {
events: {
'click': function() {
if (this.series.data.length > 1) {
this.remove();
}
}
}
}
}
},
series: [{
data: [[20, 20], [80, 80]]
}]
});
我真的很喜歡它,如果新的數據可能只是從右側滑入 - 它看起來可怕的路,它只是看起來那麼後,現有數據的變化已經出現 –