Skip to content

Instantly share code, notes, and snippets.

@wakino
Created February 3, 2016 07:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wakino/c1f6acaed5da5a54b840 to your computer and use it in GitHub Desktop.
Save wakino/c1f6acaed5da5a54b840 to your computer and use it in GitHub Desktop.
chartist.js usage
new Chartist.Bar('.ct-chart', {
labels: ['Q1', 'Q2', 'Q3', 'Q4'],
series: [
[800000, 1200000, 1400000, 1300000],
[200000, 400000, 500000, 300000],
[100000, 200000, 400000, 600000]
]
}, {
stackBars: true,
axisY: {
labelInterpolationFnc: function(value) {
return (value / 1000) + 'k';
}
}
}).on('draw', function(data) {
if(data.type === 'bar') {
data.element.attr({
style: 'stroke-width: 30px'
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment