From 47b5ad60ae798787bad97f2d478dab396536b752 Mon Sep 17 00:00:00 2001 From: Evert Timberg Date: Sun, 24 Jul 2016 18:21:24 -0400 Subject: [PATCH] Fix JSHint warnings --- src/elements/element.line.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/elements/element.line.js b/src/elements/element.line.js index 4a6cd6e4f..2c74b9b77 100644 --- a/src/elements/element.line.js +++ b/src/elements/element.line.js @@ -57,15 +57,16 @@ module.exports = function(Chart) { points.push(points[0]); } + var index, current, previous, currentVM; + // Fill Line if (points.length && vm.fill) { ctx.beginPath(); - for (var index = 0; index < points.length; ++index) { - var current = points[index]; - var previous = helpers.previousItem(points, index); - - var currentVM = current._view; + for (index = 0; index < points.length; ++index) { + current = points[index]; + previous = helpers.previousItem(points, index); + currentVM = current._view; // First point moves to it's starting position no matter what if (index === 0) { @@ -97,7 +98,7 @@ module.exports = function(Chart) { // 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 - lineToPoint(previous, current) + lineToPoint(previous, current); } else { if (loop) { ctx.lineTo(currentVM.x, currentVM.y); @@ -142,10 +143,10 @@ module.exports = function(Chart) { ctx.beginPath(); lastDrawnIndex = -1; - for (var index = 0; index < points.length; ++index) { - var current = points[index]; - var previous = helpers.previousItem(points, index); - var currentVM = current._view; + for (index = 0; index < points.length; ++index) { + current = points[index]; + previous = helpers.previousItem(points, index); + currentVM = current._view; // First point moves to it's starting position no matter what if (index === 0) { -- 2.47.2