我使用jQuery來製作餅圖。最初我傳遞默認的配置參數。之後,我想更改餅圖的bar-color
,size
等配置參數。如何更改jQuery「easy餅圖」插件的配置參數?
默認配置參數:
$('.chart').easyPieChart({
easing: 'easeOutCirc',
barColor: '#1abc9c ',
trackColor: '#f9f9f9 ',
scaleColor:false,
scaleLength: 5,
percent: 67,
lineCap: 'round',
lineWidth: 15, //12
size: 150, //110
animate: {duration: 2000, enabled: true},
onStep: function (from, to, percent) {
$(this.el).find('.percent').text(Math.round(percent));
}
});
我知道如何設置餅圖的percentage
值動態,就像在下列方式:
$('#'+domId).data('easyPieChart').update(value);
除了percentage
,我想設置動態配置參數如下:
我想設置size
,bar-color
餅圖動態年。爲此我嘗試了很多東西,但我沒有找到正確的方法。
對於這一點,我做了JSFIddle爲understanding.Initially大小點擊後應該110
上redraw
按鈕需要。但它不工作改變pie chart
大小。
告訴我,我使用的插件是否滿足我的要求?如果是這樣,我該如何解決這個問題?