diff options
author | Madhura Jayaratne <madhura.cj@gmail.com> | 2015-02-13 10:12:47 +0300 |
---|---|---|
committer | Madhura Jayaratne <madhura.cj@gmail.com> | 2015-02-13 10:12:47 +0300 |
commit | aaf0e8d903a3a84768d238833775b625cc8dc963 (patch) | |
tree | e02156f4c95692a9c3bd92275869af95e695c76a /js/chart.js | |
parent | 31aae4afa4fe71b1f52b68382e0645c7b2616271 (diff) |
Scope of JS variables defined in for loop declaration part if not local to the loop. See http://stackoverflow.com/questions/18465211/javascript-loop-variable-scope
Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
Diffstat (limited to 'js/chart.js')
-rw-r--r-- | js/chart.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/js/chart.js b/js/chart.js index 2b34a45862..fbdbeec2cf 100644 --- a/js/chart.js +++ b/js/chart.js @@ -285,8 +285,8 @@ JQPlotLineChart.prototype.populateOptions = function (dataTable, options) { } if (optional.axes.xaxis.ticks.length === 0) { var data = dataTable.getData(); - for (var i = 0; i < data.length; i++) { - optional.axes.xaxis.ticks.push(data[i][0].toString()); + for (var j = 0; j < data.length; j++) { + optional.axes.xaxis.ticks.push(data[j][0].toString()); } } return optional; @@ -574,9 +574,9 @@ JQPlotBarChart.prototype.populateOptions = function (dataTable, options) { } } if (optional.series.length === 0) { - for (var i = 1; i < columns.length; i++) { + for (var j = 1; j < columns.length; j++) { optional.series.push({ - label : columns[i].name.toString() + label : columns[j].name.toString() }); } } |