mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-07 04:39:06 +02:00
Merge pull request #1429 from etimberg/feature/unit-test
Linear scale tests
This commit is contained in:
commit
f9eb8b141e
@ -329,16 +329,6 @@
|
||||
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);
|
||||
},
|
||||
|
||||
|
@ -68,7 +68,12 @@
|
||||
clearRect: function() {},
|
||||
closePath: function() {},
|
||||
fill: function() {},
|
||||
fillText: 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 +87,7 @@
|
||||
var addMethod = function(name, method) {
|
||||
scope[methodName] = function() {
|
||||
scope.record(name, arguments);
|
||||
method.apply(scope, arguments);
|
||||
return method.apply(scope, arguments);
|
||||
};
|
||||
}
|
||||
|
||||
@ -104,6 +109,10 @@
|
||||
return this._calls;
|
||||
}
|
||||
|
||||
Context.prototype.resetCalls = function() {
|
||||
this._calls = [];
|
||||
};
|
||||
|
||||
window.createMockContext = function() {
|
||||
return new Context();
|
||||
};
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user