]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Missing draw method in Writing new chart types 431/head
authorTim Klingeleers <Mardaneus86@users.noreply.github.com>
Tue, 8 Jul 2014 11:15:23 +0000 (13:15 +0200)
committerTim Klingeleers <Mardaneus86@users.noreply.github.com>
Tue, 8 Jul 2014 11:15:23 +0000 (13:15 +0200)
Added the draw method to "Writing new chart types". If you use the template without the draw method, you get an undefined error because Chart.Type.prototype.render calls this.draw() on line 808 in Chart.Core.js.

docs/06-Advanced.md

index dd31f03ae9ca73c638f13f8ef4949473198f3ec8..f9d696da28b418db6acda41aaa287e70f350e797 100644 (file)
@@ -92,6 +92,9 @@ Chart.Type.extend({
        initialize:  function(data){
                this.chart.ctx // The drawing context for this chart
                this.chart.canvas // the canvas node for this chart
+       },
+       // Used to draw something on the canvas
+       draw: function() {
        }
 });