| title | Bar chart |
|---|
A bar chart provides a way of showing data values represented as vertical bars
See the Pen chart.xkcd bar by timqian (@timqian) on CodePen.
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>const barChart = new chartXkcd.Bar(svg, {
title: 'github stars VS patron number', // optional
// xLabel: '', // optional
// yLabel: '', // optional
data: {
labels: ['github stars', 'patrons'],
datasets: [{
data: [100, 2],
}],
},
options: { // optional
yTickCount: 2,
},
});yTickCount: customize tick numbers you want to see on the y axisdataColors: array of colors for different datasetsfontFamily: customize font family used in the chartunxkcdify: disable xkcd effect (defaultfalse)strokeColor: stroke colors (defaultblack)backgroundColor: color for BG (defaultwhite)