Built with blockbuilder.org
Last active
August 27, 2017 03:20
-
-
Save MrSteve2/3b1c3598d08151e67383552a48e94f82 to your computer and use it in GitHub Desktop.
fresh block
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>dc.js - Row Chart Example</title> | |
<meta charset="UTF-8"> | |
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css"> | |
<link rel="stylesheet" type="text/css" href="../css/dc.css"/> | |
</head> | |
<body> | |
<div class="container"> | |
<script type="text/javascript" src="header.js"></script> | |
<div id="test"></div> | |
<script type="text/javascript" src="../js/d3.js"></script> | |
<script type="text/javascript" src="../js/crossfilter.js"></script> | |
<script type="text/javascript" src="../js/dc.js"></script> | |
<script type="text/javascript"> | |
var chart = dc.rowChart("#test"); | |
d3.csv("https://github.com/dc-js/dc.js/tree/master/web/examples/morley.csv", function(error, experiments) { | |
experiments.forEach(function(x) { | |
x.Speed = +x.Speed; | |
}); | |
var ndx = crossfilter(experiments), | |
runDimension = ndx.dimension(function(d) {return +d.Run;}), | |
speedSumGroup = runDimension.group().reduceSum(function(d) {return d.Speed * d.Run / 1000;}); | |
chart | |
.width(768) | |
.height(480) | |
.x(d3.scale.linear().domain([6,20])) | |
.elasticX(true) | |
.dimension(runDimension) | |
.group(speedSumGroup) | |
.render(); | |
}); | |
</script> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment