]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Start testing the linear scale fit code
authorEvert Timberg <evert.timberg@gmail.com>
Mon, 31 Aug 2015 01:49:39 +0000 (21:49 -0400)
committerEvert Timberg <evert.timberg@gmail.com>
Mon, 31 Aug 2015 01:49:39 +0000 (21:49 -0400)
src/scales/scale.linear.js
test/mockContext.js

index eaab69c6c303eafc8591e14b124b457184ceec8e..94dd0a3ac52b75f1b5738334c44c5b1d7cc3201b 100644 (file)
                                return this.getPixelForValue(value);
                        }
 
-                       var offset = 0;
-
-                       for (var j = datasetIndex; j < this.data.datasets.length; j++) {
-                               if (j === datasetIndex && value) {
-                                       offset += value;
-                               } else {
-                                       offset = offset + value;
-                               }
-                       }
-
                        return this.getPixelForValue(value);
                },
 
index d8b8e41b8d06ce852c8a867855bc27228edeccf1..8fa62436edff6307873043efa8720fc052b9b79b 100644 (file)
                        closePath: function() {},
                        fill: function() {},
                        lineTo: function(x, y) {},
+                       measureText: function(text) {
+                               // return the number of characters * fixed size
+                               return text ? { width: text.length * 10 } : {width: 0};
+                       },
                        moveTo: function(x, y) {},
                        quadraticCurveTo: function() {},
                        restore: function() {},
@@ -82,7 +86,7 @@
                var addMethod = function(name, method) {
                        scope[methodName] = function() {
                                scope.record(name, arguments);
-                               method.apply(scope, arguments);
+                               return method.apply(scope, arguments);
                        };
                }