diff options
Diffstat (limited to 'tranches_insight/static/main.js')
| -rw-r--r-- | tranches_insight/static/main.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tranches_insight/static/main.js b/tranches_insight/static/main.js new file mode 100644 index 00000000..74bc3cdd --- /dev/null +++ b/tranches_insight/static/main.js @@ -0,0 +1,21 @@ +g2 = new Dygraph(document.getElementById("graphdiv2"), + [], // path to CSV file + { labels: [], + title: "Correlation numbers" } // options + ); + +document.getElementById('dropdown'). + addEventListener('change', function(e) { + var index = this.value.split("."); + $.getJSON("_data", + {i: index[0], s: index[1], t: index[2]}, + function(data){ + var newdata = data["data"].map(function(e){ + f = e.slice(1); + f.unshift(new Date(e[0])); + return f}); + g2.updateOptions({'file': newdata, 'labels': data['labels']}); + }); + }); +var event = new Event('change'); +document.getElementById('dropdown').dispatchEvent(event); |
