diff options
Diffstat (limited to 'app/static')
| -rw-r--r-- | app/static/js/makeChart.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/app/static/js/makeChart.js b/app/static/js/makeChart.js index 85d743b..1a0283d 100644 --- a/app/static/js/makeChart.js +++ b/app/static/js/makeChart.js @@ -3,10 +3,12 @@ function preprocessData(data) { var n = 0; - data.forEach(function(d) { - d.X = n++; - d.Y = d.value; - }); + cleanData = []; + for (i=0; i<data.values[0].raw.length; i++) { + d = data.values[0].raw[i]; + cleanData.push({"X": n++, "Y": d}); + } + return cleanData; } function scaleAndAxis(data, width, height) { @@ -50,7 +52,7 @@ function noZoom() { function baseChart(selector, data, clickFunction, annotations, annotationFunction) { // preprocess the data - preprocessData(data); + data = preprocessData(data); var divWidth = 1000; var divHeight = 480; |
