Skip to content

Instantly share code, notes, and snippets.

@joannecheng
Created November 16, 2013 16:41
Show Gist options
  • Save joannecheng/7502290 to your computer and use it in GitHub Desktop.
Save joannecheng/7502290 to your computer and use it in GitHub Desktop.
Tributary inlet
{"description":"Tributary inlet","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"pingpong","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"thumbnail":"http://i.imgur.com/OHqz9rv.png"}
var data = [{"values":[{"timestamp":1378598400000,"count":71},{"timestamp":1378684800000,"count":242},{"timestamp":1378771200000,"count":158},{"timestamp":1378857600000,"count":79},{"timestamp":1378944000000,"count":7},{"timestamp":1379030400000,"count":65},{"timestamp":1379116800000,"count":10}],"key":"chat"},{"values":[{"timestamp":1378598400000,"count":213},{"timestamp":1378684800000,"count":230},{"timestamp":1378771200000,"count":134},{"timestamp":1378857600000,"count":254},{"timestamp":1378944000000,"count":205},{"timestamp":1379030400000,"count":63},{"timestamp":1379116800000,"count":190}],"key":"offline"}];
var width = 200;
var height = 100;
function multiBarchart() {
function chart(){
console.log(data);
// generate graph here
}
chart.width = function(value) {
if (!arguments.length) return width;
width = value;
return chart;
}
chart.height = function(value) {
if (!arguments.length) return height;
height = value;
return chart;
}
return chart;
}
var svg = d3.select('body')
.append('svg')
.data(data)
.call(chart);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment