rendro / easy-pie-chart

easy pie chart is a lightweight plugin to draw simple, animated pie charts for single values
http://rendro.github.io/easy-pie-chart
MIT License
2.07k stars 501 forks source link

Change the scale to 10 instead of 100 #191

Closed B4rT26 closed 7 years ago

B4rT26 commented 7 years ago

Hi, thanks for your tool.

I'm wondering if there is a way to change the scale of the chart to 10 instead of 100. I want to display the results via points and the maximum value to achieve is 10. On the "<>Code" page is an example with "used ram" and 1000 as base, but I didn't find out yet how to change the parameters to display it that way. Is there an option embedded?

Thanks for your help!

B4rT26 commented 7 years ago

Meanwhile I've found out how to do it. If anyone is dealing with the same issue and wants to display values up to 10 instead of 100:

1) Multiple the data-percent attribut by 10 2) In script section find line: jQuery(this.el).find('.percent').text(Math.round(percent)); and divide the percent value by 10, so the edited line will be: jQuery(this.el).find('.percent').text(Math.round(percent/10));