Removes unused context bindings

This commit is contained in:
Mathias Küsel 2016-01-14 18:17:14 +01:00
parent b756507625
commit 25d6c2f064
8 changed files with 20 additions and 20 deletions

View File

@ -44,7 +44,7 @@
if (helpers.isDatasetVisible(dataset) && dataset.bar) { if (helpers.isDatasetVisible(dataset) && dataset.bar) {
++barCount; ++barCount;
} }
}, this); });
return barCount; return barCount;
}, },

View File

@ -133,7 +133,7 @@
helpers.each(this.getDataset().metaData, function(point, index) { helpers.each(this.getDataset().metaData, function(point, index) {
point.transition(easingDecimal); point.transition(easingDecimal);
point.draw(); point.draw();
}, this); });
}, },

View File

@ -219,7 +219,7 @@
var easingDecimal = ease || 1; var easingDecimal = ease || 1;
helpers.each(this.getDataset().metaData, function(arc, index) { helpers.each(this.getDataset().metaData, function(arc, index) {
arc.transition(easingDecimal).draw(); arc.transition(easingDecimal).draw();
}, this); });
}, },
setHoverStyle: function(arc) { setHoverStyle: function(arc) {

View File

@ -259,9 +259,9 @@
var easingDecimal = ease || 1; var easingDecimal = ease || 1;
// Transition Point Locations // Transition Point Locations
helpers.each(this.getDataset().metaData, function(point, index) { helpers.each(this.getDataset().metaData, function(point) {
point.transition(easingDecimal); point.transition(easingDecimal);
}, this); });
// Transition and Draw the line // Transition and Draw the line
if (this.chart.options.showLines) if (this.chart.options.showLines)

View File

@ -195,7 +195,7 @@
var easingDecimal = ease || 1; var easingDecimal = ease || 1;
helpers.each(this.getDataset().metaData, function(arc, index) { helpers.each(this.getDataset().metaData, function(arc, index) {
arc.transition(easingDecimal).draw(); arc.transition(easingDecimal).draw();
}, this); });
}, },
setHoverStyle: function(arc) { setHoverStyle: function(arc) {

View File

@ -167,7 +167,7 @@
// Transition Point Locations // Transition Point Locations
helpers.each(this.getDataset().metaData, function(point, index) { helpers.each(this.getDataset().metaData, function(point, index) {
point.transition(easingDecimal); point.transition(easingDecimal);
}, this); });
// Transition and Draw the line // Transition and Draw the line
this.getDataset().metaDataset.transition(easingDecimal).draw(); this.getDataset().metaDataset.transition(easingDecimal).draw();

View File

@ -110,14 +110,14 @@
if (this.options.scales.xAxes && this.options.scales.xAxes.length) { if (this.options.scales.xAxes && this.options.scales.xAxes.length) {
helpers.each(this.options.scales.xAxes, function(xAxisOptions, index) { helpers.each(this.options.scales.xAxes, function(xAxisOptions, index) {
xAxisOptions.id = xAxisOptions.id || (defaultXAxisID + index); xAxisOptions.id = xAxisOptions.id || (defaultXAxisID + index);
}, this); });
} }
if (this.options.scales.yAxes && this.options.scales.yAxes.length) { if (this.options.scales.yAxes && this.options.scales.yAxes.length) {
// Build the y axes // Build the y axes
helpers.each(this.options.scales.yAxes, function(yAxisOptions, index) { helpers.each(this.options.scales.yAxes, function(yAxisOptions, index) {
yAxisOptions.id = yAxisOptions.id || (defaultYAxisID + index); yAxisOptions.id = yAxisOptions.id || (defaultYAxisID + index);
}, this); });
} }
} }
}, },
@ -239,7 +239,7 @@
resetElements: function resetElements() { resetElements: function resetElements() {
helpers.each(this.data.datasets, function(dataset, datasetIndex) { helpers.each(this.data.datasets, function(dataset, datasetIndex) {
dataset.controller.reset(); dataset.controller.reset();
}, this); });
}, },
update: function update(animationDuration, lazy) { update: function update(animationDuration, lazy) {
@ -254,12 +254,12 @@
// Make sure all dataset controllers have correct meta data counts // Make sure all dataset controllers have correct meta data counts
helpers.each(this.data.datasets, function(dataset, datasetIndex) { helpers.each(this.data.datasets, function(dataset, datasetIndex) {
dataset.controller.buildOrUpdateElements(); dataset.controller.buildOrUpdateElements();
}, this); });
// This will loop through any data and do the appropriate element update for the type // This will loop through any data and do the appropriate element update for the type
helpers.each(this.data.datasets, function(dataset, datasetIndex) { helpers.each(this.data.datasets, function(dataset, datasetIndex) {
dataset.controller.update(); dataset.controller.update();
}, this); });
this.render(animationDuration, lazy); this.render(animationDuration, lazy);
}, },
@ -310,7 +310,7 @@
if (helpers.isDatasetVisible(dataset)) { if (helpers.isDatasetVisible(dataset)) {
dataset.controller.draw(ease); dataset.controller.draw(ease);
} }
}, this); });
// Finally draw the tooltip // Finally draw the tooltip
this.tooltip.transition(easingDecimal).draw(); this.tooltip.transition(easingDecimal).draw();
@ -330,9 +330,9 @@
elementsArray.push(element); elementsArray.push(element);
return elementsArray; return elementsArray;
} }
}, this); });
} }
}, this); });
return elementsArray; return elementsArray;
}, },
@ -361,7 +361,7 @@
if(helpers.isDatasetVisible(dataset)){ if(helpers.isDatasetVisible(dataset)){
elementsArray.push(dataset.metaData[found._index]); elementsArray.push(dataset.metaData[found._index]);
} }
}, this); });
return elementsArray; return elementsArray;
}, },

View File

@ -265,7 +265,7 @@
backgroundColor: active._view.backgroundColor backgroundColor: active._view.backgroundColor
}); });
} }
}, this); });
tooltipPosition = this.getAveragePosition(this._active); tooltipPosition = this.getAveragePosition(this._active);
tooltipPosition.y = this._active[0]._yScale.getPixelForDecimal(0.5); tooltipPosition.y = this._active[0]._yScale.getPixelForDecimal(0.5);
@ -330,7 +330,7 @@
ctx.font = helpers.fontString(vm.bodyFontSize, vm._bodyFontStyle, vm._bodyFontFamily); ctx.font = helpers.fontString(vm.bodyFontSize, vm._bodyFontStyle, vm._bodyFontFamily);
helpers.each(vm.beforeBody.concat(vm.afterBody), function(line) { helpers.each(vm.beforeBody.concat(vm.afterBody), function(line) {
size.width = Math.max(size.width, ctx.measureText(line).width); size.width = Math.max(size.width, ctx.measureText(line).width);
}, this); });
helpers.each(vm.body, function(line) { helpers.each(vm.body, function(line) {
size.width = Math.max(size.width, ctx.measureText(line).width + (this._options.tooltips.mode !== 'single' ? (vm.bodyFontSize + 2) : 0)); size.width = Math.max(size.width, ctx.measureText(line).width + (this._options.tooltips.mode !== 'single' ? (vm.bodyFontSize + 2) : 0));
}, this); }, this);
@ -495,7 +495,7 @@
if (i + 1 === vm.title.length) { if (i + 1 === vm.title.length) {
pt.y += vm.titleMarginBottom - vm.titleSpacing; // If Last, add margin, remove spacing pt.y += vm.titleMarginBottom - vm.titleSpacing; // If Last, add margin, remove spacing
} }
}, this); });
} }
}, },
drawBody: function drawBody(pt, vm, ctx, opacity) { drawBody: function drawBody(pt, vm, ctx, opacity) {
@ -554,7 +554,7 @@
helpers.each(vm.footer, function(footer) { helpers.each(vm.footer, function(footer) {
ctx.fillText(footer, pt.x, pt.y); ctx.fillText(footer, pt.x, pt.y);
pt.y += vm.footerFontSize + vm.footerSpacing; pt.y += vm.footerFontSize + vm.footerSpacing;
}, this); });
} }
}, },
draw: function draw() { draw: function draw() {