-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
30 lines (29 loc) · 1.24 KB
/
test.html
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
29
30
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script>
<script type="text/javascript" src="mpld3_rewrite/js/mpld3.v0.1.js"></script>
<div id="fig01"></div>
<script type="text/javascript">
var spec = {width: 600,
height: 450,
toolbar: ["reset", "move"],
data:{"line1":[[1,1],[2,3],[3,2],[4,4],[5,3],[6,5]]},
plugins:[{type:"tooltip", id:"12345"}],
axes:[{bbox: [0.1, 0.1, 0.8, 0.8],
xlim: [0, 7],
ylim: [0, 7],
gridOn: true,
lines: [{data:"line1", color:"salmon"}],
markers: [{data:"line1", facecolor:"salmon", id:"12345"}],
texts: [{position: [3,3],
text: "blue moving",
fontsize: 20,
color: "blue"},
{position: [0.4,0.5],
coordinates: "axes",
text: "red stationary",
fontsize: 20,
color: "red"}],
},
]
};
var fig = mpld3.draw_figure("fig01", spec);
</script>