blob: a797bea44060c0da1e0a496d54725bd891fb0daf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
<!doctype html>
<html>
<head>
<script type="text/javascript" src="{{ url_for('static', filename='dygraph-combined.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='jquery-2.1.1.min.js') }}"></script>
</head>
<body>
<div id="graphdiv2"
style="width:800px; height:500px;"></div>
<script type="text/javascript">
g2 = new Dygraph(document.getElementById("graphdiv2"),
[], // path to CSV file
{ labels: {{labels|tojson|safe}},
title: "Correlation numbers" } // options
);
$.getJSON("_data",
{i:"IG",s:9, t:"10yr"},
function(data){
var newdata = data["data"].map(function(e){
f = e.slice(1);
f.unshift(new Date(e[0]));
return f});
console.log(newdata);
g2.updateOptions({'file': newdata});
})
</script>
</body>
</html>
|