JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
<br/><!-- Just so that JSFiddle's Result label doesn't overlap the Chart -->
<div id="chartContainer" style="height: 360px; width: 100%;"></div>
JavaScript
var chart = new CanvasJS.Chart("chartContainer", {
title: {
text: "Monthly Sales Goal"
},
axisX: {
valueFormatString: "MMM D"
},
toolTip: {
shared: true
},
data: [
{
type: "column",
name: "Goal",
showInLegend: true,
dataPoints: [
{ x: new Date(2019, 01, 01), y: 71 },
{ x: new Date(2019, 01, 02), y: 55 },
{ x: new Date(2019, 01, 03), y: 50 },
{ x: new Date(2019, 01, 04), y: 65 },
{ x: new Date(2019, 01, 05), y: 95 }
]
}, {
type: "column",
name: "Accomplished",
showInLegend: true,
dataPoints: [
{ x: new Date(2019, 01, 01), y: 55 },
{ x: new Date(2019, 01, 02), y: 37 },
{ x: new Date(2019, 01, 03), y: 27 },
{ x: new Date(2019, 01, 04), y: 42 },
{ x: new Date(2019, 01, 05), y: 77 }
]
}
]
});
chart.render();