Donut charts fix.

This commit is contained in:
Olly Smith 2012-09-15 23:18:16 +01:00
parent 03ed32ef9b
commit 088233d8d2
3 changed files with 6 additions and 5 deletions

View File

@ -53,7 +53,7 @@ class Morris.Donut
# If you need to re-size your charts, call this method after changing the
# size of the container element.
redraw: ->
@el.clear()
@el.empty()
@r = new Raphael(@el[0])

View File

@ -87,12 +87,13 @@
}
this.data = options.data;
this.el.addClass('graph-initialised');
this.r = new Raphael(this.el[0]);
this.draw();
this.redraw();
}
Donut.prototype.draw = function() {
Donut.prototype.redraw = function() {
var C, cx, cy, d, idx, last, max_value, min, next, seg, total, w, x, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _results;
this.el.empty();
this.r = new Raphael(this.el[0]);
cx = this.el.width() / 2;
cy = this.el.height() / 2;
w = (Math.min(cx, cy) - 10) / 3;

2
morris.min.js vendored

File diff suppressed because one or more lines are too long