]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
First round of eslint fixes
authorZach Panzarino <zachary@panzarino.com>
Wed, 14 Sep 2016 18:05:19 +0000 (18:05 +0000)
committerZach Panzarino <zachary@panzarino.com>
Wed, 14 Sep 2016 18:05:19 +0000 (18:05 +0000)
37 files changed:
src/charts/Chart.Bar.js
src/charts/Chart.Bubble.js
src/charts/Chart.Doughnut.js
src/charts/Chart.Line.js
src/charts/Chart.PolarArea.js
src/charts/Chart.Radar.js
src/charts/Chart.Scatter.js
src/controllers/controller.bar.js
src/controllers/controller.bubble.js
src/controllers/controller.doughnut.js
src/controllers/controller.line.js
src/controllers/controller.polarArea.js
src/controllers/controller.radar.js
src/core/core.animation.js
src/core/core.canvasHelpers.js
src/core/core.controller.js
src/core/core.datasetController.js
src/core/core.element.js
src/core/core.helpers.js
src/core/core.js
src/core/core.layoutService.js
src/core/core.legend.js
src/core/core.plugin.js
src/core/core.scale.js
src/core/core.scaleService.js
src/core/core.title.js
src/core/core.tooltip.js
src/elements/element.arc.js
src/elements/element.line.js
src/elements/element.point.js
src/elements/element.rectangle.js
src/scales/scale.category.js
src/scales/scale.linear.js
src/scales/scale.linearbase.js
src/scales/scale.logarithmic.js
src/scales/scale.radialLinear.js
src/scales/scale.time.js

index b80100c00e4e82571f6d90388dc2df2d7c740e48..e1ad7962f9ac336a35768ebd136cbe5d0355c460 100644 (file)
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
@@ -8,4 +8,4 @@ module.exports = function(Chart) {
                return new Chart(context, config);
        };
 
-};
\ No newline at end of file
+};
index 37f4a98bb5f0cec1973c1d974a8e8b165a56edee..2de4a1047ecee7fc8686949d9f231de3cc1aa411 100644 (file)
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
@@ -7,4 +7,4 @@ module.exports = function(Chart) {
                return new Chart(context, config);
        };
 
-};
\ No newline at end of file
+};
index 41f80a244bc2ee4c7e70431040da5d98995f596a..e1e8ce54b34924781240020307dae74e6b53e270 100644 (file)
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
@@ -8,4 +8,4 @@ module.exports = function(Chart) {
                return new Chart(context, config);
        };
 
-};
\ No newline at end of file
+};
index ea328ac6eead87f6fb23e84b3ce19bb1e94c93ff..e89662ff7c12d1bee7cbc7524394f9c6549be561 100644 (file)
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
@@ -8,4 +8,4 @@ module.exports = function(Chart) {
                return new Chart(context, config);
        };
 
-};
\ No newline at end of file
+};
index 3a3e032f68058ec4be0cd19e4ada2db2bef418e7..e07e4bac5a16889e869740365b18578f59a9b27e 100644 (file)
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
@@ -8,4 +8,4 @@ module.exports = function(Chart) {
                return new Chart(context, config);
        };
 
-};
\ No newline at end of file
+};
index 322c4544af4bb47b25a656a548aedc97ff9c5b0d..1648e9faca65f323a01ad79cf2585eb9a2bfe946 100644 (file)
@@ -1,9 +1,9 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
-       
+
        Chart.Radar = function(context, config) {
-               config.options = Chart.helpers.configMerge({ aspectRatio: 1 }, config.options);
+               config.options = Chart.helpers.configMerge({aspectRatio: 1}, config.options);
                config.type = 'radar';
 
                return new Chart(context, config);
index 7ab5c5717c749efe00055bf786de2dc7c5cf154c..84594f63755ef7890d9c42fecf44b17367fbbfb5 100644 (file)
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
@@ -9,14 +9,14 @@ module.exports = function(Chart) {
 
                scales: {
                        xAxes: [{
-                               type: "linear", // scatter should not use a category axis
-                               position: "bottom",
-                               id: "x-axis-1" // need an ID so datasets can reference the scale
+                               type: 'linear', // scatter should not use a category axis
+                               position: 'bottom',
+                               id: 'x-axis-1' // need an ID so datasets can reference the scale
                        }],
                        yAxes: [{
-                               type: "linear",
-                               position: "left",
-                               id: "y-axis-1"
+                               type: 'linear',
+                               position: 'left',
+                               id: 'y-axis-1'
                        }]
                },
 
@@ -44,4 +44,4 @@ module.exports = function(Chart) {
                return new Chart(context, config);
        };
 
-};
\ No newline at end of file
+};
index 30347a28d4d7496ecfd6340da9cf394184e02b58..73ed2df2a0d33dfeeb43849795588be4c26ba380 100644 (file)
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
@@ -6,12 +6,12 @@ module.exports = function(Chart) {
 
        Chart.defaults.bar = {
                hover: {
-                       mode: "label"
+                       mode: 'label'
                },
 
                scales: {
                        xAxes: [{
-                               type: "category",
+                               type: 'category',
 
                                // Specific to Bar Controller
                                categoryPercentage: 0.8,
@@ -23,7 +23,7 @@ module.exports = function(Chart) {
                                }
                        }],
                        yAxes: [{
-                               type: "linear"
+                               type: 'linear'
                        }]
                }
        };
@@ -281,17 +281,17 @@ module.exports = function(Chart) {
        // it extends bar (like pie extends doughnut)
        Chart.defaults.horizontalBar = {
                hover: {
-                       mode: "label"
+                       mode: 'label'
                },
 
                scales: {
                        xAxes: [{
-                               type: "linear",
-                               position: "bottom"
+                               type: 'linear',
+                               position: 'bottom'
                        }],
                        yAxes: [{
-                               position: "left",
-                               type: "category",
+                               position: 'left',
+                               type: 'category',
 
                                // Specific to Horizontal Bar Controller
                                categoryPercentage: 0.8,
@@ -368,7 +368,7 @@ module.exports = function(Chart) {
                                        borderWidth: custom.borderWidth ? custom.borderWidth : helpers.getValueAtIndexOrDefault(dataset.borderWidth, index, rectangleElementOptions.borderWidth)
                                },
 
-                               draw: function () {
+                               draw: function() {
                                        var ctx = this._chart.ctx;
                                        var vm = this._view;
 
@@ -425,7 +425,7 @@ module.exports = function(Chart) {
                                        }
                                },
 
-                               inRange: function (mouseX, mouseY) {
+                               inRange: function(mouseX, mouseY) {
                                        var vm = this._view;
                                        var inRange = false;
 
@@ -444,7 +444,7 @@ module.exports = function(Chart) {
                        rectangle.pivot();
                },
 
-               calculateBarBase: function (datasetIndex, index) {
+               calculateBarBase: function(datasetIndex, index) {
                        var me = this;
                        var meta = me.getMeta();
                        var xScale = me.getScaleForId(meta.xAxisID);
@@ -470,7 +470,7 @@ module.exports = function(Chart) {
                        return xScale.getBasePixel();
                },
 
-               getRuler: function (index) {
+               getRuler: function(index) {
                        var me = this;
                        var meta = me.getMeta();
                        var yScale = me.getScaleForId(meta.yAxisID);
@@ -506,7 +506,7 @@ module.exports = function(Chart) {
                        };
                },
 
-               calculateBarHeight: function (index) {
+               calculateBarHeight: function(index) {
                        var me = this;
                        var yScale = me.getScaleForId(me.getMeta().yAxisID);
                        if (yScale.options.barThickness) {
@@ -516,7 +516,7 @@ module.exports = function(Chart) {
                        return yScale.options.stacked ? ruler.categoryHeight : ruler.barHeight;
                },
 
-               calculateBarX: function (index, datasetIndex) {
+               calculateBarX: function(index, datasetIndex) {
                        var me = this;
                        var meta = me.getMeta();
                        var xScale = me.getScaleForId(meta.xAxisID);
@@ -550,7 +550,7 @@ module.exports = function(Chart) {
                        return xScale.getPixelForValue(value);
                },
 
-               calculateBarY: function (index, datasetIndex) {
+               calculateBarY: function(index, datasetIndex) {
                        var me = this;
                        var meta = me.getMeta();
                        var yScale = me.getScaleForId(meta.yAxisID);
index 49aa50078595e34abe45a9f8e32d49cc7f8c6352..b1c6474e0ccd873abe7e60a7b08a0fec83bf93ea 100644 (file)
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
@@ -6,19 +6,19 @@ module.exports = function(Chart) {
 
        Chart.defaults.bubble = {
                hover: {
-                       mode: "single"
+                       mode: 'single'
                },
 
                scales: {
                        xAxes: [{
-                               type: "linear", // bubble should probably use a linear scale by default
-                               position: "bottom",
-                               id: "x-axis-0" // need an ID so datasets can reference the scale
+                               type: 'linear', // bubble should probably use a linear scale by default
+                               position: 'bottom',
+                               id: 'x-axis-0' // need an ID so datasets can reference the scale
                        }],
                        yAxes: [{
-                               type: "linear",
-                               position: "left",
-                               id: "y-axis-0"
+                               type: 'linear',
+                               position: 'left',
+                               id: 'y-axis-0'
                        }]
                },
 
index 096f3085a41aefa8ac08d100e7279855e8d3914f..40d4e2c842d2165a49269748e2bc51d1ebe5bf6c 100644 (file)
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
@@ -7,9 +7,9 @@ module.exports = function(Chart) {
 
        defaults.doughnut = {
                animation: {
-                       //Boolean - Whether we animate the rotation of the Doughnut
+                       // Boolean - Whether we animate the rotation of the Doughnut
                        animateRotate: true,
-                       //Boolean - Whether we animate scaling the Doughnut from the centre
+                       // Boolean - Whether we animate scaling the Doughnut from the centre
                        animateScale: false
                },
                aspectRatio: 1,
@@ -35,7 +35,7 @@ module.exports = function(Chart) {
                        }
 
                        text.push('</ul>');
-                       return text.join("");
+                       return text.join('');
                },
                legend: {
                        labels: {
@@ -84,13 +84,13 @@ module.exports = function(Chart) {
                        }
                },
 
-               //The percentage of the chart that we cut out of the middle.
+               // The percentage of the chart that we cut out of the middle.
                cutoutPercentage: 50,
 
-               //The rotation of the chart, where the first data arc begins.
+               // The rotation of the chart, where the first data arc begins.
                rotation: Math.PI * -0.5,
 
-               //The total circumference of the chart.
+               // The total circumference of the chart.
                circumference: Math.PI * 2.0,
 
                // Need to override these to give a nice default
@@ -253,7 +253,7 @@ module.exports = function(Chart) {
                                }
                        });
 
-                       /*if (total === 0) {
+                       /* if (total === 0) {
                                total = NaN;
                        }*/
 
@@ -269,8 +269,8 @@ module.exports = function(Chart) {
                        }
                },
 
-               //gets the max border or hover width to properly scale pie charts
-               getMaxBorderWidth: function (elements) {
+               // gets the max border or hover width to properly scale pie charts
+               getMaxBorderWidth: function(elements) {
                        var max = 0,
                                index = this.index,
                                length = elements.length,
index 53d3f38e6c3db1251076fc733f08255c46e87c9a..a516a1e368e9b92d8b3dd19ef5591cd91af4a022 100644 (file)
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
@@ -9,16 +9,16 @@ module.exports = function(Chart) {
                spanGaps: false,
 
                hover: {
-                       mode: "label"
+                       mode: 'label'
                },
 
                scales: {
                        xAxes: [{
-                               type: "category",
+                               type: 'category',
                                id: 'x-axis-0'
                        }],
                        yAxes: [{
-                               type: "linear",
+                               type: 'linear',
                                id: 'y-axis-0'
                        }]
                }
index 9870546245bcebe5b5ad25ac18577aa8cc8aa913..6a11b4599ac451969818d2a1bbc9f3d2a0a3cd65 100644 (file)
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
@@ -7,14 +7,14 @@ module.exports = function(Chart) {
        Chart.defaults.polarArea = {
 
                scale: {
-                       type: "radialLinear",
+                       type: 'radialLinear',
                        lineArc: true, // so that lines are circular
                        ticks: {
                                beginAtZero: true
                        }
                },
 
-               //Boolean - Whether to animate the rotation of the chart
+               // Boolean - Whether to animate the rotation of the chart
                animation: {
                        animateRotate: true,
                        animateScale: true
@@ -41,7 +41,7 @@ module.exports = function(Chart) {
                        }
 
                        text.push('</ul>');
-                       return text.join("");
+                       return text.join('');
                },
                legend: {
                        labels: {
@@ -155,7 +155,7 @@ module.exports = function(Chart) {
                                }
                        }
 
-                       //var negHalfPI = -0.5 * Math.PI;
+                       // var negHalfPI = -0.5 * Math.PI;
                        var datasetStartAngle = opts.startAngle;
                        var distance = arc.hidden ? 0 : scale.getDistanceFromCenterForValue(dataset.data[index]);
                        var startAngle = datasetStartAngle + (circumference * visibleCount);
index bc963b86835e78c7dc5aaec187200f29983b8f67..3c050595a83e8e28a034a419467746faf8ebb4d4 100644 (file)
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
@@ -6,7 +6,7 @@ module.exports = function(Chart) {
 
        Chart.defaults.radar = {
                scale: {
-                       type: "radialLinear"
+                       type: 'radialLinear'
                },
                elements: {
                        line: {
index 17c0f659782d2170a6137d25f6361c1cfe100bad..7ccb3749322b3ef36ae41aca22efc012eed19aa0 100644 (file)
@@ -1,5 +1,5 @@
-/*global window: false */
-"use strict";
+/* global window: false */
+'use strict';
 
 module.exports = function(Chart) {
 
@@ -7,7 +7,7 @@ module.exports = function(Chart) {
 
        Chart.defaults.global.animation = {
                duration: 1000,
-               easing: "easeOutQuart",
+               easing: 'easeOutQuart',
                onProgress: helpers.noop,
                onComplete: helpers.noop
        };
@@ -15,7 +15,7 @@ module.exports = function(Chart) {
        Chart.Animation = Chart.Element.extend({
                currentStep: null, // the current animation step
                numSteps: 60, // default number of steps
-               easing: "", // the easing to use for this animation
+               easing: '', // the easing to use for this animation
                render: null, // render function used by the animation service
 
                onAnimationProgress: null, // user specified callback to fire on each step of the animation
@@ -128,4 +128,4 @@ module.exports = function(Chart) {
                        }
                }
        };
-};
\ No newline at end of file
+};
index f8c35c96e6464151e2b1ddf62f5141a441e8a39e..439df7dba1b893ad060cdebe81c09f5aa5cb851e 100644 (file)
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
        // Global Chart canvas helpers object for drawing items to canvas
@@ -40,7 +40,7 @@ module.exports = function(Chart) {
                case 'rect':
                        size = 1 / Math.SQRT2 * radius;
                        ctx.beginPath();
-                       ctx.fillRect(x - size, y - size, 2 * size,  2 * size);
+                       ctx.fillRect(x - size, y - size, 2 * size, 2 * size);
                        ctx.strokeRect(x - size, y - size, 2 * size, 2 * size);
                        break;
                case 'rectRot':
@@ -101,4 +101,4 @@ module.exports = function(Chart) {
 
                ctx.stroke();
        };
-};
\ No newline at end of file
+};
index dc99400763ec3fcb3e9be706f3458c03014840ec..f996fa2b5eff3688e40e1c602afd5411d7138edb 100644 (file)
@@ -1,13 +1,13 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
        var helpers = Chart.helpers;
-       //Create a dictionary of chart types, to allow for extension of existing types
+       // Create a dictionary of chart types, to allow for extension of existing types
        Chart.types = {};
 
-       //Store a reference to each instance - allowing us to globally resize chart instances on window resize.
-       //Destroy method on the chart will remove the instance of the chart from this reference.
+       // Store a reference to each instance - allowing us to globally resize chart instances on window resize.
+       // Destroy method on the chart will remove the instance of the chart from this reference.
        Chart.instances = {};
 
        // Controllers available for dataset visualization eg. bar, line, slice, etc.
@@ -30,7 +30,7 @@ module.exports = function(Chart) {
                        }
                });
 
-               //Add the chart instance to the global namespace
+               // Add the chart instance to the global namespace
                Chart.instances[this.id] = this;
 
                if (this.options.responsive) {
@@ -99,7 +99,7 @@ module.exports = function(Chart) {
                        helpers.retinaScale(chart);
 
                        // Notify any plugins about the resize
-                       var newSize = { width: newWidth, height: newHeight };
+                       var newSize = {width: newWidth, height: newHeight};
                        Chart.plugins.notify('resize', [me, newSize]);
 
                        // Notify of resize
@@ -145,13 +145,13 @@ module.exports = function(Chart) {
                        if (options.scales) {
                                items = items.concat(
                                        (options.scales.xAxes || []).map(function(xAxisOptions) {
-                                               return { options: xAxisOptions, dtype: 'category' }; }),
+                                               return {options: xAxisOptions, dtype: 'category'}; }),
                                        (options.scales.yAxes || []).map(function(yAxisOptions) {
-                                               return { options: yAxisOptions, dtype: 'linear' }; }));
+                                               return {options: yAxisOptions, dtype: 'linear'}; }));
                        }
 
                        if (options.scale) {
-                               items.push({ options: options.scale, dtype: 'radialLinear', isDefault: true });
+                               items.push({options: options.scale, dtype: 'radialLinear', isDefault: true});
                        }
 
                        helpers.each(items, function(item) {
@@ -291,12 +291,12 @@ module.exports = function(Chart) {
                        var me = this;
                        var i, ilen;
 
-                       if (Chart.plugins.notify('beforeDatasetsUpdate', [ me ])) {
+                       if (Chart.plugins.notify('beforeDatasetsUpdate', [me])) {
                                for (i = 0, ilen = me.data.datasets.length; i < ilen; ++i) {
                                        me.getDatasetMeta(i).controller.update();
                                }
 
-                               Chart.plugins.notify('afterDatasetsUpdate', [ me ]);
+                               Chart.plugins.notify('afterDatasetsUpdate', [me]);
                        }
                },
 
@@ -307,7 +307,7 @@ module.exports = function(Chart) {
                        var animationOptions = me.options.animation;
                        if (animationOptions && ((typeof duration !== 'undefined' && duration !== 0) || (typeof duration === 'undefined' && animationOptions.duration !== 0))) {
                                var animation = new Chart.Animation();
-                               animation.numSteps = (duration || animationOptions.duration) / 16.66; //60 fps
+                               animation.numSteps = (duration || animationOptions.duration) / 16.66; // 60 fps
                                animation.easing = animationOptions.easing;
 
                                // render function
@@ -392,7 +392,7 @@ module.exports = function(Chart) {
                        var eventPosition = helpers.getRelativePosition(e, me.chart);
                        var elementsArray = [];
 
-                       var found = (function() {
+                       var found = function() {
                                if (me.data.datasets) {
                                        for (var i = 0; i < me.data.datasets.length; i++) {
                                                var meta = me.getDatasetMeta(i);
@@ -405,7 +405,7 @@ module.exports = function(Chart) {
                                                }
                                        }
                                }
-                       }).call(me);
+                       }.call(me);
 
                        if (!found) {
                                return elementsArray;
@@ -415,7 +415,7 @@ module.exports = function(Chart) {
                                if (me.isDatasetVisible(datasetIndex)) {
                                        var meta = me.getDatasetMeta(datasetIndex),
                                                element = meta.data[found._index];
-                                       if(element && !element._view.skip){
+                                       if(element && !element._view.skip) {
                                                elementsArray.push(element);
                                        }
                                }
@@ -429,7 +429,7 @@ module.exports = function(Chart) {
                        var eventPosition = helpers.getRelativePosition(e, me.chart);
                        var elementsArray = [];
 
-                       var found = (function() {
+                       var found = function() {
                                if (me.data.datasets) {
                                        for (var i = 0; i < me.data.datasets.length; i++) {
                                                var meta = me.getDatasetMeta(i);
@@ -442,7 +442,7 @@ module.exports = function(Chart) {
                                                }
                                        }
                                }
-                       }).call(me);
+                       }.call(me);
 
                        if (!found) {
                                return elementsArray;
@@ -451,7 +451,7 @@ module.exports = function(Chart) {
                        helpers.each(me.data.datasets, function(dataset, datasetIndex) {
                                if (me.isDatasetVisible(datasetIndex)) {
                                        var meta = me.getDatasetMeta(datasetIndex);
-                                       var index = helpers.findIndex(meta.data, function (it) {
+                                       var index = helpers.findIndex(meta.data, function(it) {
                                                return found._model.x === it._model.x;
                                        });
                                        if(index !== -1 && !meta.data[index]._view.skip) {
@@ -587,7 +587,7 @@ module.exports = function(Chart) {
 
                        switch (mode) {
                        case 'single':
-                               elements = [ elements[0] ];
+                               elements = [elements[0]];
                                break;
                        case 'label':
                        case 'dataset':
@@ -623,7 +623,7 @@ module.exports = function(Chart) {
                                me.tooltipActive = [];
                        } else {
                                me.active = me.getElementsAtEventForMode(e, hoverOptions.mode);
-                               me.tooltipActive =  me.getElementsAtEventForMode(e, tooltipsOptions.mode);
+                               me.tooltipActive = me.getElementsAtEventForMode(e, tooltipsOptions.mode);
                        }
 
                        // On Hover hook
index bc140800d824f3ab1862432c322b01107a838f3a..29b1aacea3593b958cc0b0e9299d1cb7eb716f39 100644 (file)
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
@@ -161,4 +161,4 @@ module.exports = function(Chart) {
        });
 
        Chart.DatasetController.extend = helpers.inherits;
-};
\ No newline at end of file
+};
index e385074ae9c4a2d1661257a00c89c23941f0f655..14c6dbad2f2cc4a4ca0d24a8a1f4794fe080151e 100644 (file)
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
index 2c69adcd5614829b2096b373cdb66fbaace0e1fe..9c021a78096f1e2f24dbd1d705f2936d355654e0 100644 (file)
@@ -1,14 +1,14 @@
-/*global window: false */
-/*global document: false */
-"use strict";
+/* global window: false */
+/* global document: false */
+'use strict';
 
 var color = require('chartjs-color');
 
 module.exports = function(Chart) {
-       //Global Chart helpers object for utility methods and classes
+       // Global Chart helpers object for utility methods and classes
        var helpers = Chart.helpers = {};
 
-       //-- Basic js utility methods
+       // -- Basic js utility methods
        helpers.each = function(loopable, callback, self, reverse) {
                // Check to see if null or undefined firstly.
                var i, len;
@@ -83,7 +83,7 @@ module.exports = function(Chart) {
                                                }
                                        });
 
-                               } else if (base.hasOwnProperty(key) && typeof base[key] === "object" && base[key] !== null && typeof value === "object") {
+                               } else if (base.hasOwnProperty(key) && typeof base[key] === 'object' && base[key] !== null && typeof value === 'object') {
                                        // If we are overwriting an object with an object, do a merge of the properties.
                                        base[key] = helpers.configMerge(base[key], value);
 
@@ -123,7 +123,7 @@ module.exports = function(Chart) {
                                                base[key].push(helpers.configMerge(Chart.scaleService.getScaleDefaults(axisType), valueObj));
                                        });
                                }
-                       } else if (base.hasOwnProperty(key) && typeof base[key] === "object" && base[key] !== null && typeof value === "object") {
+                       } else if (base.hasOwnProperty(key) && typeof base[key] === 'object' && base[key] !== null && typeof value === 'object') {
                                // If we are overwriting an object with an object, do a merge of the properties.
                                base[key] = helpers.configMerge(base[key], value);
 
@@ -210,9 +210,9 @@ module.exports = function(Chart) {
                }
        };
        helpers.inherits = function(extensions) {
-               //Basic javascript inheritance based on the model created in Backbone.js
+               // Basic javascript inheritance based on the model created in Backbone.js
                var parent = this;
-               var ChartElement = (extensions && extensions.hasOwnProperty("constructor")) ? extensions.constructor : function() {
+               var ChartElement = (extensions && extensions.hasOwnProperty('constructor')) ? extensions.constructor : function() {
                        return parent.apply(this, arguments);
                };
 
@@ -239,7 +239,7 @@ module.exports = function(Chart) {
                        return id++;
                };
        }());
-       //-- Math methods
+       // -- Math methods
        helpers.isNumber = function(n) {
                return !isNaN(parseFloat(n)) && isFinite(n);
        };
@@ -305,8 +305,8 @@ module.exports = function(Chart) {
                return (pixelWidth % 2 === 0) ? 0 : 0.5;
        };
        helpers.splineCurve = function(firstPoint, middlePoint, afterPoint, t) {
-               //Props to Rob Spencer at scaled innovation for his post on splining between points
-               //http://scaledinnovation.com/analytics/splines/aboutSplines.html
+               // Props to Rob Spencer at scaled innovation for his post on splining between points
+               // http://scaledinnovation.com/analytics/splines/aboutSplines.html
 
                // This function must also respect "skipped" points
 
@@ -402,7 +402,7 @@ module.exports = function(Chart) {
 
                        tauK = 3 / Math.sqrt(squaredMagnitude);
                        pointCurrent.mK = alphaK * tauK * pointCurrent.deltaK;
-                       pointAfter.mK = betaK  * tauK * pointCurrent.deltaK;
+                       pointAfter.mK = betaK * tauK * pointCurrent.deltaK;
                }
 
                // Compute control points
@@ -469,8 +469,8 @@ module.exports = function(Chart) {
 
                return niceFraction * Math.pow(10, exponent);
        };
-       //Easing functions adapted from Robert Penner's easing equations
-       //http://www.robertpenner.com/easing/
+       // Easing functions adapted from Robert Penner's easing equations
+       // http://www.robertpenner.com/easing/
        var easingEffects = helpers.easingEffects = {
                linear: function(t) {
                        return t;
@@ -667,7 +667,7 @@ module.exports = function(Chart) {
                        return easingEffects.easeOutBounce(t * 2 - 1) * 0.5 + 1 * 0.5;
                }
        };
-       //Request animation polyfill - http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/
+       // Request animation polyfill - http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/
        helpers.requestAnimFrame = (function() {
                return window.requestAnimationFrame ||
                        window.webkitRequestAnimationFrame ||
@@ -688,7 +688,7 @@ module.exports = function(Chart) {
                                return window.clearTimeout(callback, 1000 / 60);
                        };
        }());
-       //-- DOM methods
+       // -- DOM methods
        helpers.getRelativePosition = function(evt, chart) {
                var mouseX, mouseY;
                var e = evt.originalEvent || evt,
@@ -730,18 +730,18 @@ module.exports = function(Chart) {
                if (node.addEventListener) {
                        node.addEventListener(eventType, method);
                } else if (node.attachEvent) {
-                       node.attachEvent("on" + eventType, method);
+                       node.attachEvent('on' + eventType, method);
                } else {
-                       node["on" + eventType] = method;
+                       node['on' + eventType] = method;
                }
        };
        helpers.removeEvent = function(node, eventType, handler) {
                if (node.removeEventListener) {
                        node.removeEventListener(eventType, handler, false);
                } else if (node.detachEvent) {
-                       node.detachEvent("on" + eventType, handler);
+                       node.detachEvent('on' + eventType, handler);
                } else {
-                       node["on" + eventType] = helpers.noop;
+                       node['on' + eventType] = helpers.noop;
                }
        };
        helpers.bindEvents = function(chartInstance, arrayOfEvents, handler) {
@@ -784,7 +784,7 @@ module.exports = function(Chart) {
         * @private
         */
        function isConstrainedValue(value) {
-               return value !== undefined &&  value !== null && value !== 'none';
+               return value !== undefined && value !== null && value !== 'none';
        }
 
        // Private helper to get a constraint dimension
@@ -859,12 +859,12 @@ module.exports = function(Chart) {
                canvas.style.width = width + 'px';
                canvas.style.height = height + 'px';
        };
-       //-- Canvas methods
+       // -- Canvas methods
        helpers.clear = function(chart) {
                chart.ctx.clearRect(0, 0, chart.width, chart.height);
        };
        helpers.fontString = function(pixelSize, fontStyle, fontFamily) {
-               return fontStyle + " " + pixelSize + "px " + fontFamily;
+               return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;
        };
        helpers.longestText = function(ctx, font, arrayOfThings, cache) {
                cache = cache || {};
@@ -904,7 +904,7 @@ module.exports = function(Chart) {
                }
                return longest;
        };
-       helpers.measureText = function (ctx, data, gc, longest, string) {
+       helpers.measureText = function(ctx, data, gc, longest, string) {
                var textWidth = data[string];
                if (!textWidth) {
                        textWidth = data[string] = ctx.measureText(string).width;
@@ -1000,7 +1000,7 @@ module.exports = function(Chart) {
                function(obj) {
                        return Object.prototype.toString.call(obj) === '[object Array]';
                };
-       //! @see http://stackoverflow.com/a/14853974
+       // ! @see http://stackoverflow.com/a/14853974
        helpers.arrayEquals = function(a0, a1) {
                var i, ilen, v0, v1;
 
index 9000dbd223cf8aa696576344fd177beded040e85..c4f65e5cacd0295bc5c96e01d242243b6f27cc5d 100755 (executable)
@@ -1,12 +1,12 @@
-"use strict";
+'use strict';
 
 module.exports = function() {
 
-       //Occupy the global variable of Chart, and create a simple base class
+       // Occupy the global variable of Chart, and create a simple base class
        var Chart = function(context, config) {
                var me = this;
                var helpers = Chart.helpers;
-               me.config = config || { 
+               me.config = config || {
                        data: {
                                datasets: []
                        }
@@ -19,7 +19,7 @@ module.exports = function() {
 
                // Support a canvas domnode
                if (context.getContext) {
-                       context = context.getContext("2d");
+                       context = context.getContext('2d');
                }
 
                me.ctx = context;
@@ -62,13 +62,13 @@ module.exports = function() {
 
        };
 
-       //Globally expose the defaults to allow for user updating/changing
+       // Globally expose the defaults to allow for user updating/changing
        Chart.defaults = {
                global: {
                        responsive: true,
                        responsiveAnimationDuration: 0,
                        maintainAspectRatio: true,
-                       events: ["mousemove", "mouseout", "click", "touchstart", "touchmove"],
+                       events: ['mousemove', 'mouseout', 'click', 'touchstart', 'touchmove'],
                        hover: {
                                onHover: null,
                                mode: 'single',
@@ -77,7 +77,7 @@ module.exports = function() {
                        onClick: null,
                        defaultColor: 'rgba(0,0,0,0.1)',
                        defaultFontColor: '#666',
-                       defaultFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
+                       defaultFontFamily: '\'Helvetica Neue\', \'Helvetica\', \'Arial\', sans-serif',
                        defaultFontSize: 12,
                        defaultFontStyle: 'normal',
                        showLines: true,
@@ -98,7 +98,7 @@ module.exports = function() {
                                }
                                text.push('</ul>');
 
-                               return text.join("");
+                               return text.join('');
                        }
                }
        };
index 6e649b13a7d8fa758d7958b3bdf3ebc4112308e2..324e93f5f0d76f2eaf4adcd82c3d0bddb627cc26 100644 (file)
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
@@ -36,21 +36,21 @@ module.exports = function(Chart) {
                        var yPadding = 0;
 
                        var leftBoxes = helpers.where(chartInstance.boxes, function(box) {
-                               return box.options.position === "left";
+                               return box.options.position === 'left';
                        });
                        var rightBoxes = helpers.where(chartInstance.boxes, function(box) {
-                               return box.options.position === "right";
+                               return box.options.position === 'right';
                        });
                        var topBoxes = helpers.where(chartInstance.boxes, function(box) {
-                               return box.options.position === "top";
+                               return box.options.position === 'top';
                        });
                        var bottomBoxes = helpers.where(chartInstance.boxes, function(box) {
-                               return box.options.position === "bottom";
+                               return box.options.position === 'bottom';
                        });
 
                        // Boxes that overlay the chartarea such as the radialLinear scale
                        var chartAreaBoxes = helpers.where(chartInstance.boxes, function(box) {
-                               return box.options.position === "chartArea";
+                               return box.options.position === 'chartArea';
                        });
 
                        // Ensure that full width boxes are at the very top / bottom
index 7691cab225c3e5bc0d3f52611362b24277a837b2..7c78dc1cecbb7dcfbce8be630db279a8f59aeb3d 100644 (file)
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
@@ -151,7 +151,7 @@ module.exports = function(Chart) {
                buildLabels: function() {
                        var me = this;
                        me.legendItems = me.options.labels.generateLabels.call(me, me.chart);
-                       if(me.options.reverse){
+                       if(me.options.reverse) {
                                me.legendItems.reverse();
                        }
                },
@@ -200,7 +200,7 @@ module.exports = function(Chart) {
                                        var lineWidths = me.lineWidths = [0];
                                        var totalHeight = me.legendItems.length ? fontSize + (labelOpts.padding) : 0;
 
-                                       ctx.textAlign = "left";
+                                       ctx.textAlign = 'left';
                                        ctx.textBaseline = 'top';
 
                                        helpers.each(me.legendItems, function(legendItem, i) {
@@ -277,7 +277,7 @@ module.exports = function(Chart) {
 
                // Shared Methods
                isHorizontal: function() {
-                       return this.options.position === "top" || this.options.position === "bottom";
+                       return this.options.position === 'top' || this.options.position === 'bottom';
                },
 
                // Actualy draw the legend on the canvas
@@ -301,7 +301,7 @@ module.exports = function(Chart) {
                                        labelFont = helpers.fontString(fontSize, fontStyle, fontFamily);
 
                                // Canvas setup
-                               ctx.textAlign = "left";
+                               ctx.textAlign = 'left';
                                ctx.textBaseline = 'top';
                                ctx.lineWidth = 0.5;
                                ctx.strokeStyle = fontColor; // for strikethrough effect
index d6f95c4d11782d55d856da87decfd168d4425529..b675fbe3172eaf8f643a8a9507dc6806ede01c7f 100644 (file)
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
index 8faa49ef50f418277c541f06a5733d5eaadf47bb..7a5613c0ffe55d89fb039bfbf4fa86aa6945e129 100644 (file)
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
@@ -6,19 +6,19 @@ module.exports = function(Chart) {
 
        Chart.defaults.scale = {
                display: true,
-               position: "left",
+               position: 'left',
 
                // grid line settings
                gridLines: {
                        display: true,
-                       color: "rgba(0, 0, 0, 0.1)",
+                       color: 'rgba(0, 0, 0, 0.1)',
                        lineWidth: 1,
                        drawBorder: true,
                        drawOnChartArea: true,
                        drawTicks: true,
                        tickMarkLength: 10,
                        zeroLineWidth: 1,
-                       zeroLineColor: "rgba(0,0,0,0.25)",
+                       zeroLineColor: 'rgba(0,0,0,0.25)',
                        offsetGridLines: false,
                        borderDash: [],
                        borderDashOffset: 0.0
@@ -192,8 +192,8 @@ module.exports = function(Chart) {
                        var globalDefaults = Chart.defaults.global;
                        var optionTicks = me.options.ticks;
 
-                       //Get the width of each grid by calculating the difference
-                       //between x offsets between 0 and 1.
+                       // Get the width of each grid by calculating the difference
+                       // between x offsets between 0 and 1.
                        var tickFontSize = helpers.getValueOrDefault(optionTicks.fontSize, globalDefaults.defaultFontSize);
                        var tickFontStyle = helpers.getValueOrDefault(optionTicks.fontStyle, globalDefaults.defaultFontStyle);
                        var tickFontFamily = helpers.getValueOrDefault(optionTicks.fontFamily, globalDefaults.defaultFontFamily);
@@ -225,7 +225,7 @@ module.exports = function(Chart) {
                                        // only the index matters for a dataset scale, but we want a consistent interface between scales
                                        var tickWidth = me.getPixelForTick(1) - me.getPixelForTick(0) - 6;
 
-                                       //Max label rotation can be set or default to 90 - also act as a loop counter
+                                       // Max label rotation can be set or default to 90 - also act as a loop counter
                                        while (labelWidth > tickWidth && me.labelRotation < optionTicks.maxRotation) {
                                                cosRotation = Math.cos(helpers.toRadians(me.labelRotation));
                                                sinRotation = Math.sin(helpers.toRadians(me.labelRotation));
@@ -386,7 +386,7 @@ module.exports = function(Chart) {
 
                // Shared Methods
                isHorizontal: function() {
-                       return this.options.position === "top" || this.options.position === "bottom";
+                       return this.options.position === 'top' || this.options.position === 'bottom';
                },
                isFullWidth: function() {
                        return (this.options.fullWidth);
@@ -403,7 +403,7 @@ module.exports = function(Chart) {
                                return NaN;
                        }
                        // If it is in fact an object, dive in one more level
-                       if (typeof(rawValue) === "object") {
+                       if (typeof(rawValue) === 'object') {
                                if ((rawValue instanceof Date) || (rawValue.isValid)) {
                                        return rawValue;
                                } else {
@@ -447,7 +447,7 @@ module.exports = function(Chart) {
                },
 
                // Utility for getting the pixel location of a percentage of scale
-               getPixelForDecimal: function(decimal /*, includeOffset*/ ) {
+               getPixelForDecimal: function(decimal /* , includeOffset*/) {
                        var me = this;
                        if (me.isHorizontal()) {
                                var innerWidth = me.width - (me.paddingLeft + me.paddingRight);
@@ -553,10 +553,10 @@ module.exports = function(Chart) {
                        }
 
 
-                       var xTickStart = options.position === "right" ? me.left : me.right - tl;
-                       var xTickEnd = options.position === "right" ? me.left + tl : me.right;
-                       var yTickStart = options.position === "bottom" ? me.top : me.bottom - tl;
-                       var yTickEnd = options.position === "bottom" ? me.top + tl : me.bottom;
+                       var xTickStart = options.position === 'right' ? me.left : me.right - tl;
+                       var xTickEnd = options.position === 'right' ? me.left + tl : me.right;
+                       var yTickStart = options.position === 'bottom' ? me.top : me.bottom - tl;
+                       var yTickEnd = options.position === 'bottom' ? me.top + tl : me.bottom;
 
                        helpers.each(me.ticks, function(label, index) {
                                // If the callback returned a null or undefined value, do not draw this line
@@ -577,7 +577,7 @@ module.exports = function(Chart) {
                                        // Draw the first index specially
                                        lineWidth = gridLines.zeroLineWidth;
                                        lineColor = gridLines.zeroLineColor;
-                               } else  {
+                               } else {
                                        lineWidth = helpers.getValueAtIndexOrDefault(gridLines.lineWidth, index);
                                        lineColor = helpers.getValueAtIndexOrDefault(gridLines.color, index);
                                }
index 7c351e5d289f6e2396854255376b811782ed1d28..81a95079053a74e499dbced14d49b741870245ad 100644 (file)
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
@@ -37,4 +37,4 @@ module.exports = function(Chart) {
                        });
                }
        };
-};
\ No newline at end of file
+};
index 25abad2a743b2e81086047d9b097ea0a2e31970c..0a8c1a5aa54c24531cfcbe440c57726dd9e25212 100644 (file)
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
@@ -30,7 +30,7 @@ module.exports = function(Chart) {
 
                // These methods are ordered by lifecyle. Utilities then follow.
 
-               beforeUpdate: function () {
+               beforeUpdate: function() {
                        var chartOpts = this.chart.options;
                        if (chartOpts && chartOpts.title) {
                                this.options = helpers.configMerge(Chart.defaults.global.title, chartOpts.title);
@@ -136,7 +136,7 @@ module.exports = function(Chart) {
                // Shared Methods
                isHorizontal: function() {
                        var pos = this.options.position;
-                       return pos === "top" || pos === "bottom";
+                       return pos === 'top' || pos === 'bottom';
                },
 
                // Actualy draw the title block on the canvas
index 8da2fa44e431e14d33a2def1cb3ceed6cfe30ffa..e59b26a2d7499beb7928a587bd81e6044890ed73 100755 (executable)
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
@@ -8,24 +8,24 @@ module.exports = function(Chart) {
                enabled: true,
                custom: null,
                mode: 'single',
-               backgroundColor: "rgba(0,0,0,0.8)",
-               titleFontStyle: "bold",
+               backgroundColor: 'rgba(0,0,0,0.8)',
+               titleFontStyle: 'bold',
                titleSpacing: 2,
                titleMarginBottom: 6,
-               titleFontColor: "#fff",
-               titleAlign: "left",
+               titleFontColor: '#fff',
+               titleAlign: 'left',
                bodySpacing: 2,
-               bodyFontColor: "#fff",
-               bodyAlign: "left",
-               footerFontStyle: "bold",
+               bodyFontColor: '#fff',
+               bodyAlign: 'left',
+               footerFontStyle: 'bold',
                footerSpacing: 2,
                footerMarginTop: 6,
-               footerFontColor: "#fff",
-               footerAlign: "left",
+               footerFontColor: '#fff',
+               footerAlign: 'left',
                yPadding: 6,
                xPadding: 6,
-               yAlign : 'center',
-               xAlign : 'center',
+               yAlign: 'center',
+               xAlign: 'center',
                caretSize: 5,
                cornerRadius: 6,
                multiKeyBackground: '#fff',
@@ -86,7 +86,7 @@ module.exports = function(Chart) {
        function pushOrConcat(base, toPush) {
                if (toPush) {
                        if (helpers.isArray(toPush)) {
-                               //base = base.concat(toPush);
+                               // base = base.concat(toPush);
                                Array.prototype.push.apply(base, toPush);
                        } else {
                                base.push(toPush);
@@ -107,7 +107,7 @@ module.exports = function(Chart) {
 
                for (i = 0, len = elements.length; i < len; ++i) {
                        var el = elements[i];
-                       if (el && el.hasValue()){
+                       if (el && el.hasValue()) {
                                var pos = el.tooltipPosition();
                                xPositions.push(pos.x);
                                yPositions.push(pos.y);
@@ -117,7 +117,7 @@ module.exports = function(Chart) {
                var x = 0,
                        y = 0;
                for (i = 0; i < xPositions.length; ++i) {
-                       if (xPositions[ i ]) {
+                       if (xPositions[i]) {
                                x += xPositions[i];
                                y += yPositions[i];
                        }
@@ -158,8 +158,8 @@ module.exports = function(Chart) {
                                        // Positioning
                                        xPadding: tooltipOpts.xPadding,
                                        yPadding: tooltipOpts.yPadding,
-                                       xAlign : tooltipOpts.xAlign,
-                                       yAlign : tooltipOpts.yAlign,
+                                       xAlign: tooltipOpts.xAlign,
+                                       yAlign: tooltipOpts.yAlign,
 
                                        // Body
                                        bodyFontColor: tooltipOpts.bodyFontColor,
@@ -292,8 +292,8 @@ module.exports = function(Chart) {
 
                                // If the user provided a sorting function, use it to modify the tooltip items
                                if (opts.itemSort) {
-                                       tooltipItems = tooltipItems.sort(function(a,b) {
-                                               return opts.itemSort(a,b, data);
+                                       tooltipItems = tooltipItems.sort(function(a, b) {
+                                               return opts.itemSort(a, b, data);
                                        });
                                }
 
@@ -571,7 +571,7 @@ module.exports = function(Chart) {
 
                        if (title.length) {
                                ctx.textAlign = vm._titleAlign;
-                               ctx.textBaseline = "top";
+                               ctx.textBaseline = 'top';
 
                                var titleFontSize = vm.titleFontSize,
                                        titleSpacing = vm.titleSpacing;
@@ -597,7 +597,7 @@ module.exports = function(Chart) {
                        var body = vm.body;
 
                        ctx.textAlign = vm._bodyAlign;
-                       ctx.textBaseline = "top";
+                       ctx.textBaseline = 'top';
 
                        var bodyFontColor = helpers.color(vm.bodyFontColor);
                        var textColor = bodyFontColor.alpha(opacity * bodyFontColor.alpha()).rgbString();
@@ -659,7 +659,7 @@ module.exports = function(Chart) {
                                pt.y += vm.footerMarginTop;
 
                                ctx.textAlign = vm._footerAlign;
-                               ctx.textBaseline = "top";
+                               ctx.textBaseline = 'top';
 
                                var footerFontColor = helpers.color(vm.footerFontColor);
                                ctx.fillStyle = footerFontColor.alpha(opacity * footerFontColor.alpha()).rgbString();
index 64d9604836520a5f8edaa440c7e1d0f00316b113..6056e847762380a19eb19dea7672f7ba6725b17c 100644 (file)
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
@@ -7,7 +7,7 @@ module.exports = function(Chart) {
 
        globalOpts.elements.arc = {
                backgroundColor: globalOpts.defaultColor,
-               borderColor: "#fff",
+               borderColor: '#fff',
                borderWidth: 2
        };
 
@@ -32,7 +32,7 @@ module.exports = function(Chart) {
                                        angle = pointRelativePosition.angle,
                                        distance = pointRelativePosition.distance;
 
-                               //Sanitise angle range
+                               // Sanitise angle range
                                var startAngle = vm.startAngle;
                                var endAngle = vm.endAngle;
                                while (endAngle < startAngle) {
@@ -45,7 +45,7 @@ module.exports = function(Chart) {
                                        angle += 2.0 * Math.PI;
                                }
 
-                               //Check if within the range of the open/close angle
+                               // Check if within the range of the open/close angle
                                var betweenAngles = (angle >= startAngle && angle <= endAngle),
                                        withinRadius = (distance >= vm.innerRadius && distance <= vm.outerRadius);
 
index 2267fef675384ab40f40d7e41ef4d42c05bc422e..6ce178fbd6e5b2e64dff6346b76ced8548772ddc 100644 (file)
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
@@ -34,7 +34,7 @@ module.exports = function(Chart) {
                                var vm = point._view;
                                if (point._view.steppedLine === true) {
                                        ctx.lineTo(point._view.x, previousPoint._view.y);
-                                       ctx.lineTo(point._view.x, point._view.y);                               
+                                       ctx.lineTo(point._view.x, point._view.y);
                                } else if (point._view.tension === 0) {
                                        ctx.lineTo(vm.x, vm.y);
                                } else {
@@ -94,7 +94,7 @@ module.exports = function(Chart) {
                                                        }
                                                } else {
                                                        if (lastDrawnIndex !== (index - 1)) {
-                                                               // There was a gap and this is the first point after the gap. If we've never drawn a point, this is a special case. 
+                                                               // There was a gap and this is the first point after the gap. If we've never drawn a point, this is a special case.
                                                                // If the first data point is NaN, then there is no real gap to skip
                                                                if (spanGaps && lastDrawnIndex !== -1) {
                                                                        // We are spanning the gap, so simple draw a line to this point
@@ -174,4 +174,4 @@ module.exports = function(Chart) {
                        ctx.restore();
                }
        });
-};
\ No newline at end of file
+};
index 4131f8ceded7c2bc12dfd76ae116aaf92d9d42b4..474ef252f53cd76af282f1fa5fbd167b90001d11 100644 (file)
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
index dd252a76cf61f7c1d78381ad7fafbda741b7bbb1..6752228c8703c8a210231edd826766850d246eb3 100644 (file)
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
@@ -92,4 +92,4 @@ module.exports = function(Chart) {
                }
        });
 
-};
\ No newline at end of file
+};
index 6d9c33b646dc1e50e2600f8c428b070f03cbb0d6..4979f193e5b7c70fddcaf250abd2a196e48d650c 100644 (file)
@@ -1,11 +1,11 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
        var helpers = Chart.helpers;
        // Default config for a category scale
        var defaultConfig = {
-               position: "bottom"
+               position: 'bottom'
        };
 
        var DatasetScale = Chart.Scale.extend({
@@ -126,6 +126,6 @@ module.exports = function(Chart) {
                }
        });
 
-       Chart.scaleService.registerScaleType("category", DatasetScale, defaultConfig);
+       Chart.scaleService.registerScaleType('category', DatasetScale, defaultConfig);
 
-};
\ No newline at end of file
+};
index 2c19f71a7b70f22cf2f4260ad510f0153649bc8d..33a3e4930db8dcd82117bdb79ddfa9714b3c8929 100644 (file)
@@ -1,11 +1,11 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
        var helpers = Chart.helpers;
 
        var defaultConfig = {
-               position: "left",
+               position: 'left',
                ticks: {
                        callback: function(tickValue, index, ticks) {
                                // If we have lots of ticks, don't use the ones
@@ -194,6 +194,6 @@ module.exports = function(Chart) {
                        return this.getPixelForValue(this.ticksAsNumbers[index]);
                }
        });
-       Chart.scaleService.registerScaleType("linear", LinearScale, defaultConfig);
+       Chart.scaleService.registerScaleType('linear', LinearScale, defaultConfig);
 
-};
\ No newline at end of file
+};
index e9e8cefa6daca5dd8b446710d0012cb41b8162fc..37caa03593351496ed63094907774b0663cfef74 100644 (file)
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
@@ -122,4 +122,4 @@ module.exports = function(Chart) {
                        Chart.Scale.prototype.convertTicksToLabels.call(me);
                }
        });
-};
\ No newline at end of file
+};
index fe3e44c4f18f253a0ee000975903ed989ef8a5c6..2535deaa69effacf92dc3860b82bc29031c2c640 100644 (file)
@@ -1,18 +1,18 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
        var helpers = Chart.helpers;
 
        var defaultConfig = {
-               position: "left",
+               position: 'left',
 
                // label settings
                ticks: {
                        callback: function(value, index, arr) {
                                var remain = value / (Math.pow(10, Math.floor(helpers.log10(value))));
 
-                               if (value === 0){
+                               if (value === 0) {
                                        return '0';
                                } else if (remain === 1 || remain === 2 || remain === 5 || index === 0 || index === arr.length - 1) {
                                        return value.toExponential();
@@ -144,7 +144,7 @@ module.exports = function(Chart) {
                                var exp;
                                var significand;
 
-                               if(tickVal === 0){
+                               if(tickVal === 0) {
                                        exp = Math.floor(helpers.log10(me.minNotZero));
                                        significand = Math.round(me.minNotZero / Math.pow(10, exp));
                                } else {
@@ -221,20 +221,20 @@ module.exports = function(Chart) {
                        } else {
                                // Bottom - top since pixels increase downard on a screen
                                innerDimension = me.height - (paddingTop + paddingBottom);
-                               if(start === 0 && !tickOpts.reverse){
+                               if(start === 0 && !tickOpts.reverse) {
                                        range = helpers.log10(me.end) - helpers.log10(me.minNotZero);
                                        if (newVal === start) {
                                                pixel = me.bottom - paddingBottom;
-                                       } else if(newVal === me.minNotZero){
+                                       } else if(newVal === me.minNotZero) {
                                                pixel = me.bottom - paddingBottom - innerDimension * 0.02;
                                        } else {
                                                pixel = me.bottom - paddingBottom - innerDimension * 0.02 - (innerDimension * 0.98/ range * (helpers.log10(newVal)-helpers.log10(me.minNotZero)));
                                        }
-                               } else if (me.end === 0 && tickOpts.reverse){
+                               } else if (me.end === 0 && tickOpts.reverse) {
                                        range = helpers.log10(me.start) - helpers.log10(me.minNotZero);
                                        if (newVal === me.end) {
                                                pixel = me.top + paddingTop;
-                                       } else if(newVal === me.minNotZero){
+                                       } else if(newVal === me.minNotZero) {
                                                pixel = me.top + paddingTop + innerDimension * 0.02;
                                        } else {
                                                pixel = me.top + paddingTop + innerDimension * 0.02 + (innerDimension * 0.98/ range * (helpers.log10(newVal)-helpers.log10(me.minNotZero)));
@@ -262,6 +262,6 @@ module.exports = function(Chart) {
                        return value;
                }
        });
-       Chart.scaleService.registerScaleType("logarithmic", LogarithmicScale, defaultConfig);
+       Chart.scaleService.registerScaleType('logarithmic', LogarithmicScale, defaultConfig);
 
-};
\ No newline at end of file
+};
index d0cb7f2c6d08d2d6c594585c08340cc5a97aa179..d6eef1c04299558d042d4ab0a9269a75a3abb8ba 100644 (file)
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
 
 module.exports = function(Chart) {
 
@@ -8,37 +8,37 @@ module.exports = function(Chart) {
        var defaultConfig = {
                display: true,
 
-               //Boolean - Whether to animate scaling the chart from the centre
+               // Boolean - Whether to animate scaling the chart from the centre
                animate: true,
                lineArc: false,
-               position: "chartArea",
+               position: 'chartArea',
 
                angleLines: {
                        display: true,
-                       color: "rgba(0, 0, 0, 0.1)",
+                       color: 'rgba(0, 0, 0, 0.1)',
                        lineWidth: 1
                },
 
                // label settings
                ticks: {
-                       //Boolean - Show a backdrop to the scale label
+                       // Boolean - Show a backdrop to the scale label
                        showLabelBackdrop: true,
 
-                       //String - The colour of the label backdrop
-                       backdropColor: "rgba(255,255,255,0.75)",
+                       // String - The colour of the label backdrop
+                       backdropColor: 'rgba(255,255,255,0.75)',
 
-                       //Number - The backdrop padding above & below the label in pixels
+                       // Number - The backdrop padding above & below the label in pixels
                        backdropPaddingY: 2,
 
-                       //Number - The backdrop padding to the side of the label in pixels
+                       // Number - The backdrop padding to the side of the label in pixels
                        backdropPaddingX: 2
                },
 
                pointLabels: {
-                       //Number - Point label font size in pixels
+                       // Number - Point label font size in pixels
                        fontSize: 10,
 
-                       //Function - Used to convert point labels
+                       // Function - Used to convert point labels
                        callback: function(label) {
                                return label;
                        }
@@ -347,7 +347,7 @@ module.exports = function(Chart) {
                                                        }
 
                                                        ctx.textAlign = 'center';
-                                                       ctx.textBaseline = "middle";
+                                                       ctx.textBaseline = 'middle';
                                                        ctx.fillStyle = tickFontColor;
                                                        ctx.fillText(label, me.xCenter, yHeight);
                                                }
@@ -412,6 +412,6 @@ module.exports = function(Chart) {
                        }
                }
        });
-       Chart.scaleService.registerScaleType("radialLinear", LinearRadialScale, defaultConfig);
+       Chart.scaleService.registerScaleType('radialLinear', LinearRadialScale, defaultConfig);
 
 };
index 23435aa13ee65fad398e339260f38c1b3a2ae313..7895dd490c589024011b02e284c45a9e5a48b8dc 100755 (executable)
@@ -1,5 +1,5 @@
-/*global window: false */
-"use strict";
+/* global window: false */
+'use strict';
 
 var moment = require('moment');
 moment = typeof(moment) === 'function' ? moment : window.moment;
@@ -39,7 +39,7 @@ module.exports = function(Chart) {
        };
 
        var defaultConfig = {
-               position: "bottom",
+               position: 'bottom',
 
                time: {
                        parser: false, // false == a pattern string from http://momentjs.com/docs/#/parsing/string-format/ or a custom callback that converts its argument to a moment
@@ -451,13 +451,13 @@ module.exports = function(Chart) {
                        }
                        // Custom parsing (return an instance of moment)
                        if (typeof me.options.time.format !== 'string' && me.options.time.format.call) {
-                               console.warn("options.time.format is deprecated and replaced by options.time.parser. See http://nnnick.github.io/Chart.js/docs-v2/#scales-time-scale");
+                               console.warn('options.time.format is deprecated and replaced by options.time.parser. See http://nnnick.github.io/Chart.js/docs-v2/#scales-time-scale');
                                return me.options.time.format(label);
                        }
                        // Moment format parsing
                        return moment(label, me.options.time.format);
                }
        });
-       Chart.scaleService.registerScaleType("time", TimeScale, defaultConfig);
+       Chart.scaleService.registerScaleType('time', TimeScale, defaultConfig);
 
 };