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
window.onload = function () {
var chart = new CanvasJS.Chart("chartContainer",{
title:{
text: "rangeArea chart"
},
data: [
{
type: "rangeArea",
color: "red",
dataPoints: [
{ x: 122.2, y: [100,100]},
{ x: 122.2, y: [2150,2150]},
{ x: 121.4, y: [2150,2150]},
{ x: 121.6, y: [1500,1500]},
]
},
{
type: "rangeArea",
color: "green",
dataPoints: [
{ x: 122.1, y: [100,1500]},
{ x: 122, y: [100,1500]},
{ x: 121.6, y: [1500,1500]},
{ x: 122, y: [100,100]},
{ x: 122.1, y: [100,100]},
]
}]
});
chart.render();
}