Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Total option, jquery.easypiechart.js #122

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion dist/jquery.easypiechart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/**
Expand Down Expand Up @@ -212,6 +212,7 @@ var CanvasRenderer = function(el, options) {

var EasyPieChart = function(el, opts) {
var defaultOptions = {
total: 100,
barColor: '#ef1e25',
trackColor: '#f9f9f9',
scaleColor: '#dfe0e0',
Expand Down
5 changes: 5 additions & 0 deletions docs/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ You can pass these options to the initialize function to set a custom look and f
<td><strong>barColor</strong></td>
<td>#ef1e25</td>
<td>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.</td>
</tr>
<tr>
<td><strong>total</strong></td>
<td>100</td>
<td>The total value of the chart. To customize the unit suffix displayed, see draw callback in your script</td>
</tr>
<tr>
<td><strong>trackColor</strong></td>
Expand Down