Skip to content

Instantly share code, notes, and snippets.

@cddesja
Created December 3, 2014 15:33
Show Gist options
  • Save cddesja/66dfb4413a747ce8b3bc to your computer and use it in GitHub Desktop.
Save cddesja/66dfb4413a747ce8b3bc to your computer and use it in GitHub Desktop.
Scatterplot
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<link rel='stylesheet' href='//tenxer.github.io/xcharts/css/master.css'>
<script src='//d3js.org/d3.v2.min.js' type='text/javascript'></script>
<script src='//tenxer.github.io/xcharts/js/xcharts.min.js' type='text/javascript'></script>
<style>
.rChart {
display: block;
margin-left: auto;
margin-right: auto;
width: 600px;
height: 400px;
}
</style>
</head>
<body >
<figure id = 'chart3f62490970fe' class = 'rChart xcharts'></figure>
<script type='text/javascript'>
var data = {
"dom": "chart3f62490970fe",
"width": 600,
"height": 400,
"xScale": "ordinal",
"yScale": "linear",
"main": [
{
"data": [
{
"x": "10%",
"y": 0.0017087
},
{
"x": "20%",
"y": 0.0019546
},
{
"x": "30%",
"y": 0.0022061
},
{
"x": "40%",
"y": 0.0027011
},
{
"x": "50%",
"y": 0.0031389
},
{
"x": "complete",
"y": 0.0015254
}
]
},
{
"data": [
{
"x": "10%",
"y": 0.0015713
},
{
"x": "20%",
"y": 0.0017432
},
{
"x": "30%",
"y": 0.0020624
},
{
"x": "40%",
"y": 0.0053279
},
{
"x": "50%",
"y": 0.0085727
},
{
"x": "complete",
"y": 0.0013858
}
]
}
],
"id": "chart3f62490970fe"
},
chartType = "line-dotted",
myChart = new xChart(chartType, data, '#chart3f62490970fe');
</script>
<style>figure.rChart {height: 400px;}</style>
<script></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment