I am using jQuery easy pie chart plugin for making pie charts. Initially I pass default configuration parameters. After that I want to change configuration parameters like bar-color
, size
of pie chart.
Default configuration parameters:
$('.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));
}
});
I know how to set the percentage
value of pie-chart dynamically, just like in the following way:
$('#'+domId).data('easyPieChart').update(value);
Except percentage
, I want to set configuration parameters dynamically like:
I want to set size
, bar-color
of pie chart dynamically. For this I tried a lot of things but I didn't find the right way.
For this,I made JSFIddle for understanding.Initially size should be 110
after click on redraw
button needs to change the size of pie chart
.But it's not working.
Tell me, does the plugin I am using fulfill my requirements? If it does, how can I fix this?
It seems that, as of now, the "easy pie chart" does not support dynamic options.
See https://github.com/rendro/easy-pie-chart/issues/65
If you want to stick with the plugin, you might want to recreate the chart completely on modifications (i.e. destroy the previous chart and create a new one).