Skip to content

Instantly share code, notes, and snippets.

Created May 23, 2012 00:43
  • Star 10 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save lgrammel/2772585 to your computer and use it in GitHub Desktop.
D3.xml Example
<!DOCTYPE html>
<title>D3.xml Example</title>
<script type="text/javascript" src=""></script>
<style type="text/css">
.chart div {
font: 10px sans-serif;
background-color: steelblue;
text-align: right;
padding: 3px;
margin: 1px;
color: white;
<div id="chart" class="chart">
d3.xml("values.xml", "application/xml", function(xml) {"#chart")
.style("width", function(d) { return d.textContent * 10 + "px"; })
.text(function(d) { return d.textContent; });
<?xml version="1.0" encoding="UTF-8" ?>
Copy link

kba commented Oct 26, 2015

See here for an up-to-date example:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment