-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdual-axis.html
60 lines (53 loc) · 1.42 KB
/
dual-axis.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
<!doctype html>
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="content-type" />
<meta charset="utf-8">
<title>ESPN Cricinfo - Match Centre</title>
<link rel="stylesheet" href="./css/styles.css">
</head>
<style type="text/css" media="screen">
html{
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
}
body{
background: #f0f7ff;
}
.espn-gfx{
float:left;
clear:both;
padding-bottom:10px;
}
.espn-gfx .axis path, .espn-gfx .axis line {
fill: none;
stroke: #ced2d3;
}
.espn-gfx .axisRight line{
stroke : #7dcc5f;
}
.espn-gfx .axisLeft line{
stroke : #f9901d;
}
</style>
<body>
<div id="espn-dual-axis" class="espn-gfx"></div>
<script src="./bower_components/d3/d3.js"></script>
<script src="./bower_components/d3.chart/d3.chart.js"></script>
<script src="./js/espn.gfx.random.js"></script>
<script src="./js/espn.gfx.dual-axis.js"></script>
<script>
var interval = 4000;
setInterval(function(){
dualAxis.draw(espn.gfx.random.dualAxis());
},interval);
var dualAxis = d3.select("#espn-dual-axis")
.chart("dual-axis",{
width : 290,
height : 185,
keyLeftMargin : 180, /*(use to move the location of legends/keys)*/
chartTitle : 'SPELLS (in overs)',
key : ['Runs','Balls']
});
dualAxis.draw(espn.gfx.random.dualAxis());
</script>
</body>