[英]How can i update the text of more than one label with the same class name using the input blur event
[英]Can I animate plotbands and put more than one label to each plotband using the Highstock API?
我正在使用highstock API,我想在圖表上繪制一些plotBands。 我想知道在繪制繪圖區時是否有任何動畫方法,例如當寬度改變時應用於html元素的CSS過渡。 我也想知道是否可以為一個繪圖區分配多個標簽。 我在jsfiddle中看到了很多示例,其中一個繪圖區只有一個標簽,但是我想為每個繪圖區放置兩個標簽,以顯示其起點和終點。
提前致謝。
您可以在渲染的對象上使用Renderer.rect並觸發animate()函數,而不是使用圖帶。 結果,新的形狀被動畫化了。
var yAxis = chart.yAxis[0],
xAxis = chart.xAxis[0],
start = 1,
end = 2,
x1 = xAxis.toPixels(start),
x2 = xAxis.toPixels(end);
var plotBand = chart.renderer.rect(x1, chart.plotTop, 0, chart.plotHeight)
.attr({
fill: 'yellow',
zIndex: 0
})
.add();
plotBand.animate({
width: x2 - x1
});
例:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.