diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/static/js/makeChart.js | 4 | ||||
| -rw-r--r-- | app/static/js/makeChartMulti.js | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/app/static/js/makeChart.js b/app/static/js/makeChart.js index 9ee0e2e..0301a5a 100644 --- a/app/static/js/makeChart.js +++ b/app/static/js/makeChart.js @@ -13,6 +13,10 @@ function preprocessData(data) { run = []; continue; } + // NOTE: remember that this *must* be 0-based indexing, as the + // change point index is ultimately retrieved from this X + // value and the Python code is 0-based as well. Thus, the + // first item should get X = 0. run.push({"X": n++, "Y": d}); } cleanData.push(run); diff --git a/app/static/js/makeChartMulti.js b/app/static/js/makeChartMulti.js index bbe0993..59f5acb 100644 --- a/app/static/js/makeChartMulti.js +++ b/app/static/js/makeChartMulti.js @@ -20,7 +20,10 @@ function preprocess(data) { // console.log("Time axis is not implemented yet. Ignoring."); } for (i=0; i<data.values[0].raw.length; i++) { - var item = {"X": i} + // NOTE: never change this to 1-based indexing. This index is + // ultimately stored in the database as the change point + // index! + var item = {"X": i}; for (j=0; j<nVar; j++) { item["Y" + j] = data.values[j].raw[i]; } |
