From 55f26825f86e782a05f8585e0d8e25cd1cf9812a Mon Sep 17 00:00:00 2001 From: Creeall Date: Fri, 30 Jan 2015 18:48:00 +0100 Subject: [PATCH 1/4] Update jquery.easypiechart.js Added a Total option to give users the ability to create per 100, per 24, per 60, per 365, etc. charts. --- dist/jquery.easypiechart.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dist/jquery.easypiechart.js b/dist/jquery.easypiechart.js index c2a4bcf..96a98f4 100644 --- a/dist/jquery.easypiechart.js +++ b/dist/jquery.easypiechart.js @@ -183,7 +183,7 @@ var CanvasRenderer = function(el, options) { } // draw bar - drawCircle(color, options.lineWidth, percent / 100); + drawCircle(color, options.lineWidth, percent / options.total); }.bind(this); /** @@ -212,6 +212,7 @@ var CanvasRenderer = function(el, options) { var EasyPieChart = function(el, opts) { var defaultOptions = { + total: 100, barColor: '#ef1e25', trackColor: '#f9f9f9', scaleColor: '#dfe0e0', From 507f25a3a3526456fe924dffefca58f7d8cada83 Mon Sep 17 00:00:00 2001 From: Creeall Date: Wed, 18 Feb 2015 09:57:14 +0100 Subject: [PATCH 2/4] Update Readme.md --- Readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Readme.md b/Readme.md index e4b8c91..01ed7ee 100644 --- a/Readme.md +++ b/Readme.md @@ -1,3 +1,5 @@ +> Modified version that add the option to set the total value. So you can build pies with any units. (days, hours, %,...) + # easyPieChart > Lightweight plugin to render simple, animated and retina optimized pie charts From 05908efe11f1b06c8781aae76a3348347e36d83d Mon Sep 17 00:00:00 2001 From: Creeall Date: Wed, 18 Feb 2015 10:00:16 +0100 Subject: [PATCH 3/4] Update options.md From 44da27740c07fa12907baa9b2240ef17af87fa32 Mon Sep 17 00:00:00 2001 From: Creeall Date: Wed, 18 Feb 2015 10:02:08 +0100 Subject: [PATCH 4/4] Update options.md --- docs/options.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/options.md b/docs/options.md index 9165d01..cd9d9a2 100644 --- a/docs/options.md +++ b/docs/options.md @@ -10,6 +10,11 @@ You can pass these options to the initialize function to set a custom look and f barColor #ef1e25 The color of the curcular bar. You can either pass a valid css color string, or a function that takes the current percentage as a value and returns a valid css color string. + + + total + 100 + The total value of the chart. To customize the unit suffix displayed, see draw callback in your script trackColor