vizkit.js is an opinionated little charting library built on top of the amazing and wonderful d3.js visualization framework.
// single bar chart data
var data = [
[
{"key": "blue", "xValue": '1', "yValue": '1'},
{"key": "blue", "xValue": '2', "yValue": '2'},
{"key": "blue", "xValue": '3', "yValue": '3'},
{"key": "blue", "xValue": '4', "yValue": '4'},
{"key": "blue", "xValue": '5', "yValue": '5'}
]
];
// multi bar chart data
var data = [
[
{"key": "blue", "xValue": '1', "yValue": '1'},
{"key": "blue", "xValue": '2', "yValue": '2'},
{"key": "blue", "xValue": '3', "yValue": '3'},
{"key": "blue", "xValue": '4', "yValue": '4'},
{"key": "blue", "xValue": '5', "yValue": '5'}
],
[
{"key": "red", "xValue": '1', "yValue": '3'},
{"key": "red", "xValue": '2', "yValue": '4'},
{"key": "red", "xValue": '3', "yValue": '2'},
{"key": "red", "xValue": '4', "yValue": '6'},
{"key": "red", "xValue": '5', "yValue": '5'}
],
[
{"key": "green", "xValue": '1', "yValue": '9'},
{"key": "green", "xValue": '2', "yValue": '6'},
{"key": "green", "xValue": '3', "yValue": '1'},
{"key": "green", "xValue": '4', "yValue": '2'},
{"key": "green", "xValue": '5', "yValue": '2'}
],
[
{"key": "yellow", "xValue": '1', "yValue": '10'},
{"key": "yellow", "xValue": '2', "yValue": '7'},
{"key": "yellow", "xValue": '3', "yValue": '2'},
{"key": "yellow", "xValue": '4', "yValue": '1'},
{"key": "yellow", "xValue": '5', "yValue": '3'}
],
];
var DrawViz = vizkit.barchart(data)
.xAxis({scale: 'ordinal'})
.legend({addMouseoverClasses: true, symbol: {type: 'square'}})
.tooltip({content: "<h1>{{key}}:</h1><p>{{xValue}}, {{yValue}}</p>"});
DrawViz(d3.select('.viz'));