Reuseable line chart. Basic.
xxxxxxxxxx
<meta charset="utf-8">
<head>
<script src="https://d3js.org/d3.v3.js"></script>
<script src="line-chart.js"></script>
<style>
body {
font: 10px sans-serif;
}
.line {
fill: none;
stroke: steelblue;
stroke-width: 1.5px;
}
.axis path, .axis line {
fill: none;
stroke: #000;
shape-rendering: crispEdges;
}
</style>
</head>
<body>
<script type="text/javascript">
var data = d3.range(20).map(function(d){return {"x":d,"y":Math.floor(Math.random() * 100)}}),
lc = lineChart();
d3.select("body").datum(data)
.call(lc);
</script>
</body>
Modified http://d3js.org/d3.v3.js to a secure url
https://d3js.org/d3.v3.js