]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Fix JSHint errors 1551/head
authoretimberg <evert.timberg@gmail.com>
Wed, 21 Oct 2015 00:33:51 +0000 (20:33 -0400)
committeretimberg <evert.timberg@gmail.com>
Wed, 21 Oct 2015 00:33:51 +0000 (20:33 -0400)
13 files changed:
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.doughnut.js
src/controllers/controller.polarArea.js
src/controllers/controller.radar.js
src/core/core.controller.js
src/core/core.helpers.js
src/core/core.scale.js
src/elements/element.arc.js
src/scales/scale.category.js

index 333a0bbebebdef9cf9912c76ff2cdf1aea075959..05a9764bd5d0749d092c52f01eb21867dbcd22a9 100644 (file)
@@ -15,6 +15,6 @@
                config.type = 'doughnut';
 
                return new Chart(context, config);
-       }
+       };
        
 }).call(this);
index d5e7cf76c06277e67b6ff2de18c9e110c8dd3303..8e26f09b5948b7e9e4b060a7b2198766ef881d14 100644 (file)
@@ -9,6 +9,6 @@
                config.type = 'line';
 
                return new Chart(context, config);
-       }
+       };
        
 }).call(this);
index 9dbdf1b39a1584fdd4579b45036ba240c948eba4..20171f7f70e9a0c1127a636e3c1d01999894400b 100644 (file)
@@ -15,6 +15,6 @@
                config.type = 'polarArea';
 
                return new Chart(context, config);
-       }
+       };
        
 }).call(this);
index 2f1f8260620bd5387b29bf14b14b24c5d9372dee..7680e25f7a8aef8435e037e3955187664ce93f63 100644 (file)
@@ -14,6 +14,6 @@
                config.type = 'radar';
 
                return new Chart(context, config);
-       }
+       };
        
 }).call(this);
index 8863ed5e6ddbc7e5cab0cabe5513a372d76b45a3..ee1ec474a368446aa641883eb4381658cc0ae29e 100644 (file)
@@ -34,6 +34,6 @@
                config.options = helpers.configMerge(defaultConfig, config.options);
                config.type = 'line';
                return new Chart(context, config);
-       }
+       };
        
 }).call(this);
\ No newline at end of file
index 4ab4850589bf3a8e0c0506f3e57bc55f83c60c8b..1188a7c2b5721d0d5d647754388fa78e7779f033 100644 (file)
@@ -92,7 +92,7 @@
                        // Make sure that we handle number of datapoints changing
                        if (numData < numArcs) {
                                // Remove excess bars for data points that have been removed
-                               this.getDataset().metaData.splice(numData, numArcs - numData)
+                               this.getDataset().metaData.splice(numData, numArcs - numData);
                        } else if (numData > numArcs) {
                                // Add new elements
                                for (var index = numArcs; index < numData; ++index) {
index 709cc15913c7847714f50630257c3493de5a9370..45e4b33a57baecf6ef5fbde7ca577688ba3c0386 100644 (file)
@@ -87,7 +87,7 @@
                        // Make sure that we handle number of datapoints changing
                        if (numData < numPoints) {
                                // Remove excess bars for data points that have been removed
-                               this.getDataset().metaData.splice(numData, numPoints - numData)
+                               this.getDataset().metaData.splice(numData, numPoints - numData);
                        } else if (numData > numPoints) {
                                // Add new elements
                                for (var index = numPoints; index < numData; ++index) {
                },
 
        });
-
-
-
-       return;
-
-
-       Chart.Type.extend({});
-
 }).call(this);
index 40fc4a7abda3dfb542902da9de57f6f8f41cd2af..ddbff5e1515dbf4fe1383eee6bdc46be7f3f87c5 100644 (file)
                        // Make sure that we handle number of datapoints changing
                        if (numData < numPoints) {
                                // Remove excess bars for data points that have been removed
-                               this.getDataset().metaData.splice(numData, numPoints - numData)
+                               this.getDataset().metaData.splice(numData, numPoints - numData);
                        } else if (numData > numPoints) {
                                // Add new elements
                                for (var index = numPoints; index < numData; ++index) {
index 773f54319b9f6f9ece60277f487a244edce349be..8cb9bcd2d4896f1f46cbbd59eb43440f96f30e80 100644 (file)
 
                                this.scale = scale;
 
-                               this.scales['radialScale'] = scale;
+                               this.scales.radialScale = scale;
                        }
 
                        Chart.scaleService.update(this, this.chart.width, this.chart.height);
 
                        helpers.each(this.data.datasets, function(dataset, datasetIndex) {
                                if (helpers.isDatasetVisible(dataset)) {
-                                       for (var elementIndex = 0; elementIndex < dataset.metaData.length; elementIndex++) {
-                                               if (dataset.metaData[elementIndex].inLabelRange(eventPosition.x, eventPosition.y)) {
+                                       helpers.each(dataset.metaData, function(element, elementIndex) {
+                                               if (element.inLabelRange(eventPosition.x, eventPosition.y)) {
                                                        helpers.each(dataset.metaData, function(element, index) {
                                                                elementsArray.push(element);
                                                        }, this);
                                                }
-                                       }
+                                       }, this);
                                }
                        }, this);
 
                                                break;
                                        case 'label':
                                        case 'dataset':
-                                               for (var i = 0; i < this.active.length; i++) {
-                                                       this.data.datasets[this.active[i]._datasetIndex].controller.setHoverStyle(this.active[i]);
+                                               for (var j = 0; j < this.active.length; j++) {
+                                                       this.data.datasets[this.active[j]._datasetIndex].controller.setHoverStyle(this.active[j]);
                                                }
                                                break;
                                        default:
index a15b06b44e56720bd04e080412d45da383cb4b5e..ca27c7c3c85862ed9678e477840ef7dce1cf5c3b 100644 (file)
                                                                        base[key].push(helpers.configMerge(valueObj.type ? Chart.scaleService.getScaleDefaults(valueObj.type) : {}, valueObj));
                                                                } else if (valueObj.type !== base[key][index].type) {
                                                                        // Type changed. Bring in the new defaults before we bring in valueObj so that valueObj can override the correct scale defaults
-                                                                       base[key][index] = helpers.configMerge(base[key][index], valueObj.type ? Chart.scaleService.getScaleDefaults(valueObj.type) : {}, valueObj)
+                                                                       base[key][index] = helpers.configMerge(base[key][index], valueObj.type ? Chart.scaleService.getScaleDefaults(valueObj.type) : {}, valueObj);
                                                                } else {
                                                                        // Type is the same
                                                                        base[key][index] = helpers.configMerge(base[key][index], valueObj);
                },
                log10 = helpers.log10 = function(x) {
                        if (Math.log10) {
-                               return Math.log10(x)
+                               return Math.log10(x);
                        } else {
                                return Math.log(x) / Math.LN10;
                        }
                                // can use classlist
                                hiddenIframe.classlist.add(hiddenIframeClass);
                        } else {
-                               hiddenIframe.setAttribute('class', hiddenIframeClass)
+                               hiddenIframe.setAttribute('class', hiddenIframeClass);
                        }
 
                        // Set the style
                                if (callback) {
                                        callback();
                                }
-                       }
+                       };
                },
                removeResizeListener = helpers.removeResizeListener = function(node) {
                        var hiddenIframe = node.querySelector('.chartjs-hidden-iframe');
index 23b5a9b70d2cdc659f9e89a4bdf48d61c0e008ec..3a1373efa921e8b478a4017d3b4d6d9a4153bc77 100644 (file)
 
                                // Reset position before calculating rotation
                                this.top = 0;
-                               this.bottom = this.height
+                               this.bottom = this.height;
                        }
 
                        // Reset padding
index 209c505d9315b906fc02bfe30f4f24597d4fb851..615cab86737cb0a268e0d80ecd0d55383ccf5d42 100644 (file)
@@ -45,7 +45,7 @@
 
                                // Put into the range of (-PI/2, 3PI/2]
                                var startAngle = vm.startAngle < (-0.5 * Math.PI) ? vm.startAngle + (2.0 * Math.PI) : vm.startAngle > (1.5 * Math.PI) ? vm.startAngle - (2.0 * Math.PI) : vm.startAngle;
-                               var endAngle = vm.endAngle < (-0.5 * Math.PI) ? vm.endAngle + (2.0 * Math.PI) : vm.endAngle > (1.5 * Math.PI) ? vm.endAngle - (2.0 * Math.PI) : vm.endAngle
+                               var endAngle = vm.endAngle < (-0.5 * Math.PI) ? vm.endAngle + (2.0 * Math.PI) : vm.endAngle > (1.5 * Math.PI) ? vm.endAngle - (2.0 * Math.PI) : vm.endAngle;
 
                                //Check if within the range of the open/close angle
                                var betweenAngles = (pointRelativePosition.angle >= startAngle && pointRelativePosition.angle <= endAngle),
index a2e569d4cfaa5e5ee3f9b4851e16ee2644694c25..7e572b864c3606a68249208babead78a7cf47622 100644 (file)
             if (this.isHorizontal()) {
                 var innerWidth = this.width - (this.paddingLeft + this.paddingRight);
                 var valueWidth = innerWidth / Math.max((this.data.labels.length - ((this.options.gridLines.offsetGridLines) ? 0 : 1)), 1);
-                var valueOffset = (valueWidth * index) + this.paddingLeft;
+                var widthOffset = (valueWidth * index) + this.paddingLeft;
 
                 if (this.options.gridLines.offsetGridLines && includeOffset) {
-                    valueOffset += (valueWidth / 2);
+                    widthOffset += (valueWidth / 2);
                 }
 
-                return this.left + Math.round(valueOffset);
+                return this.left + Math.round(widthOffset);
             } else {
                 var innerHeight = this.height - (this.paddingTop + this.paddingBottom);
                 var valueHeight = innerHeight / Math.max((this.data.labels.length - ((this.options.gridLines.offsetGridLines) ? 0 : 1)), 1);
-                var valueOffset = (valueHeight * index) + this.paddingTop;
+                var heightOffset = (valueHeight * index) + this.paddingTop;
 
                 if (this.options.gridLines.offsetGridLines && includeOffset) {
-                    valueOffset += (valueHeight / 2);
+                    heightOffset += (valueHeight / 2);
                 }
 
-                return this.top + Math.round(valueOffset);
+                return this.top + Math.round(heightOffset);
             }
         },
     });