-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
setData option for the Donut Chart #211
Comments
I was able to extend the Donut object like so: window.Morris.Donut.prototype.setData = function(data, redraw) {
if (redraw == null) {
redraw = true;
}
this.data = data;
this.values = (function() {
var _i, _len, _ref, _results;
_ref = this.data;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
row = _ref[_i];
_results.push(parseFloat(row.value));
}
return _results;
}).call(this);
this.dirty = true;
if (redraw) {
return this.redraw();
}
} |
Thank you jcandeli, but this source doesn't work, I always have : This would be a good idea if this part of source will be directly integrated in next release. |
Are you sure you added my code after the morris.js code? It seems to work for me in this jsfiddle. |
Yes I did, It works now after multiple tests.
It's not the same thing that
Thank you again for your Donut's extend |
Great. Glad it helped. |
I would still like to see setData get added to all of them. I love this library, but sometimes I have to go an extra length to make it something display the way I want it. |
Morris.Donut setData() method is in master now - check it out and let me know if it doesn't work for you! |
Thanks! I'll try it out. |
can i use .CSV file to get data and show in charts ? Bcoz i m using .NET ans Sql srver to Get data from Database... |
Thanks.... |
Would be great for the donut chart to also have the setData method.
In it's absence, what is the best way to destroy the donut chart and clean up event handlers?
The text was updated successfully, but these errors were encountered: