JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://rawgit.com/nnnick/Chart.js/9368c6079d989527dcd2072b6f18780b53e3113c/Chart.js"></script>
<canvas id="barChart" width="700" height="400"></canvas>
JavaScript
var _data = {
labels: ["01-01",
"01-04",
"01-15",
"02-03",
"03-25",
"04-03",
"04-14",
"05-27",
"05-27",
"08-03"],
datasets: [{
data: [5, 13, 23, 20, 5, 13, 23, 20, 110, 2],
label: "female",
borderColor: "rgba(197,23,1,0.8)",
backgroundColor: "rgba(197,23,1,0.4)",
hoverBackgroundColor: "rgba(197,23,1,1)",
borderWidth: 1,
pointBorderColor: "rgba(197,23,1,1)",
pointBackgroundColor: "rgba(255,255,255,0.8)",
pointBorderWidth: 1.5,
tension: -1,
yAxisID: "y-axis-1",
}, ],
};
var _options = {
scales: {
xAxes: [{
categorySpacing: 0
}],
yAxes: [{
type: "linear",
display: true,
position: "left",
id: "y-axis-1",
}]
}
};
var myBar = new Chart(document.getElementById("barChart").getContext("2d"), {
type: "bar",
data: _data,
options: _options
});