-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbars.html
76 lines (67 loc) · 1.75 KB
/
bars.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
<!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;
}
.mcr-chart-axis path, .mcr-chart-axis line {
fill: none;
stroke: #ced2d3;
}
/*.espn-gfx .axisRight line{
stroke : #7dcc5f;
}
.espn-gfx .axisLeft line{
stroke : #f9901d;
}*/
</style>
<body>
<div id="espn-bars1" class="espn-gfx"></div>
<div id="espn-bars2" 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.bars.js"></script>
<script>
var interval = 4000;
setInterval(function(){
bars1.draw(espn.gfx.random.dualAxis());
bars2.draw(espn.gfx.random.bars());
},interval);
var bars1 = d3.select("#espn-bars1")
.chart("bars",{
width : 290,
height : 185,
keyLeftMargin : 180, /*(use to move the location of legends/keys)*/
chartTitle : 'SPELLS (in overs)',
key : ['Runs','Balls'],
dualAxis : true
});
bars1.draw(espn.gfx.random.dualAxis());
var bars2 = d3.select("#espn-bars2")
.chart("bars",{
width : 290,
height : 185,
keyLeftMargin : 160,
chartTitle : 'OVERS',
key : ['Normal','Powerplay'],
barSpacing: 3,
colors : ['#f9901d', 'orangered']
});
bars2.draw(espn.gfx.random.bars());
</script>
</body>