From: Tanner Linsley Date: Fri, 12 Feb 2016 06:45:14 +0000 (-0700) Subject: Core helpers reference X-Git-Tag: v2.0.0~48^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eb01a0d6f8744aab4449c62e5d9f5fb409a9f369;p=thirdparty%2FChart.js.git Core helpers reference --- diff --git a/src/core/core.js b/src/core/core.js index 4bb22c8a3..80105af55 100755 --- a/src/core/core.js +++ b/src/core/core.js @@ -2,8 +2,6 @@ module.exports = function() { - var helpers = require('./core.helpers') - //Occupy the global variable of Chart, and create a simple base class var Chart = function(context, config) { this.config = config; @@ -25,8 +23,8 @@ module.exports = function() { // If the canvas has a specified width and height, we use those else // we look to see if the canvas node has a CSS width and height. // If there is still no height, fill the parent container - this.width = context.canvas.width || parseInt(helpers.getStyle(context.canvas, 'width')) || helpers.getMaximumWidth(context.canvas); - this.height = context.canvas.height || parseInt(helpers.getStyle(context.canvas, 'height')) || helpers.getMaximumHeight(context.canvas); + this.width = context.canvas.width || parseInt(Chart.helpers.getStyle(context.canvas, 'width')) || Chart.helpers.getMaximumWidth(context.canvas); + this.height = context.canvas.height || parseInt(Chart.helpers.getStyle(context.canvas, 'height')) || Chart.helpers.getMaximumHeight(context.canvas); this.aspectRatio = this.width / this.height; @@ -42,7 +40,7 @@ module.exports = function() { this.originalCanvasStyleHeight = context.canvas.style.height; // High pixel density displays - multiply the size of the canvas height/width by the device pixel ratio, then scale. - helpers.retinaScale(this); + Chart.helpers.retinaScale(this); if (config) { this.controller = new Chart.Controller(this); @@ -50,7 +48,7 @@ module.exports = function() { // Always bind this so that if the responsive state changes we still work var _this = this; - helpers.addResizeListener(context.canvas.parentNode, function() { + Chart.helpers.addResizeListener(context.canvas.parentNode, function() { if (_this.controller && _this.controller.config.options.responsive) { _this.controller.resize(); }