[ Launch: Stacked Bar Chart Example ] 6264539 by lewis500
[ Launch: Stacked Bar Chart Example ] 6264512 by lewis500
No parent Inlet
-
-
Save lewis500/6264539 to your computer and use it in GitHub Desktop.
Stacked Bar Chart Setup
This file contains 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
{"description":"Stacked Bar Chart Setup","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"inlet.svg":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"editor_editor":{"coffee":false,"vim":false,"emacs":false,"width":579,"height":573,"hide":false},"thumbnail":"http://i.imgur.com/zleU5Kw.png"} |
This file contains 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
var svg = d3.select("svg"); | |
var data = [ | |
[{y:21},{y:10},{y:10},{y:38},{y:20}], | |
[{y:14},{y:25},{y:21},{y:10},{y:10}], | |
[{y:14},{y:35},{y:21},{y:10},{y:4}] | |
]; | |
var height = 416; | |
//make a color scale, stackify the data, then draw the rects on a group you can translate around |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment