-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path39923056.html
More file actions
47 lines (40 loc) · 1.2 KB
/
39923056.html
File metadata and controls
47 lines (40 loc) · 1.2 KB
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
<!DOCTYPE html>
<html>
<head>
<title>D3.xml Example</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.v2.js"></script>
<style type="text/css">
.chart div {
font: 10px sans-serif;
background-color: steelblue;
text-align: right;
padding: 3px;
margin: 1px;
color: white;
display:inline-block;
width:30px;
}
.howard {
background-color: red;
}
</style>
</head>
<body>
<div id="chart" class="chart">
</div>
<script>
var _xml = '';
d3.xml("updatedphillies.xml", "application/xml", function(xml) {
_xml = xml;
d3.select("#chart")
.selectAll("div")
.data(xml.documentElement.getElementsByTagName("doubles"))
.enter().append("div")
.style("height", function(d) { return d.textContent * 1 + 10 + "px"; })
.text(function(d) { return d.textContent; });
console.log(xml.documentElement.getElementsByTagName("player"));
});
console.log(_xml);
</script>
</body>
</html>