JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
<div id="chartContainer" style="height: 300px; width: 100%;"></div>
JavaScript
var chart = new CanvasJS.Chart("chartContainer", {
title:{
text: "Creating Shapes using Area Chart"
},
axisX: {
interval:1,
},
data: [
{
type: "line",
dataPoints: [
{ x: 1, y: 2 },
{ x: 2, y: 3 },
{ x: 3, y: 4 },
{ x: 4, y: 5 },
{ x: 5, y: 6 },
{ x: 6, y: 7 }
]
},
{
type: "area",
toolTipContent: null,
markerSize: 0,
highlightEnabled: false,
dataPoints: [
{ x: 1, y: 2 },
{ x: 2, y: 4 },
{ x: 3, y: 2 },
{ x: 3, y: -2 },
{ x: 2, y: -4 },
{ x: 1, y: -2 },
{ x: 1, y: 2 }
]
}]
});
chart.render();