-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresponsive.html
82 lines (76 loc) · 1.54 KB
/
responsive.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!DOCTYPE html>
<html>
<head>
<style>
.axis path {
fill: none;
stroke: #C0C0C0;
shape-rendering: crispEdges;
}
.tick line {
stroke: #C0C0C0;
shape-rendering: crispEdges;
}
.line-1 {
fill: none;
stroke: #7591FF;
}
.line-1 .symbol {
fill: white;
}
.key-1 {
fill: #7591FF;
cursor: pointer;
}
.viz {
height: 500px;
margin: 20px;
cursor: crosshair;
}
.area {
fill: steelBlue;
}
.y-title, .x-title {
font-size: 20px;
font-weight: bold;
}
.legend {
font-size: 12px;
}
.vizkit-tooltip {
background-color: whiteSmoke;
padding: 5px;
border: 1px solid #E0E0E0;
}
.vizkit-tooltip h1 {
font-size: 12px;
}
</style>
</head>
<body>
<div class="viz"></div>
<script src="../lib/d3.js"></script>
<script src="../vizkit.js"></script>
<script>
var data = [
[
{"key": "foobar", "xValue": '1', "yValue": '1'},
{"key": "foobar", "xValue": '2', "yValue": '2'},
{"key": "foobar", "xValue": '3', "yValue": '3'},
{"key": "foobar", "xValue": '4', "yValue": '4'},
{"key": "foobar", "xValue": '5', "yValue": '5'}
]
];
var DrawViz = vizkit.linechart(data)
.yAxis({title: 'foo', scale: 'linear', gridLine: true})
.xAxis({title: 'bar', scale: 'linear', gridLine: true})
.legend({addMouseoverClasses: false, symbol: {type: 'square'}})
.tooltip({content: "<h1>{{key}}:</h1><p>{{xValue}}, {{yValue}}</p>"});
DrawViz(d3.select('.viz'));
window.onresize = function(event) {
d3.select('.viz svg').remove();
DrawViz(d3.select('.viz'));
}
</script>
</body>
</html>