JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://cdn.canvasjs.com/canvasjs.min.js"></script>
<br/><!-- Just so that JSFiddle's Result label doesn't overlap the Chart -->
<div id="chartContainer" style="height: 400px; width: 100%;"></div>
JavaScript
var chart = new CanvasJS.Chart("chartContainer", {
zoomEnabled: true,
zoomType: "x",
axisX: {
labelFontSize: 24,
valueFormatString: "HH:mm",
labelAngle: -90,
labelMaxWidth: 100,
scaleBreaks: {
customBreaks: [
{
startValue: new Date("2024-05-13T12:00:01.000Z"),
endValue: new Date("2024-05-14T03:59:59.000Z")
},
{
startValue: new Date("2024-05-14T12:00:01.000Z"),
endValue: new Date("2024-05-15T03:59:59.000Z")
},
{
startValue: new Date("2024-05-15T12:00:01.000Z"),
endValue: new Date("2024-05-16T03:59:59.000Z")
},
{
startValue: new Date("2024-05-16T12:00:01.000Z"),
endValue: new Date("2024-05-17T03:59:59.000Z")
}
]
},
minimum: new Date("2024-05-13T04:00:00.000Z"),
maximum: new Date("2024-05-17T12:00:00.000Z")
},
data: [
{
type: "line",
dataPoints: [
{
x: new Date("2024-05-13T04:35:49.699Z"),
y: 1,
},
{
x: new Date("2024-05-13T04:42:47.632Z"),
y: 1,
},
{
x: new Date("2024-05-13T05:00:59.985Z"),
y: 1,
},
{
x: new Date("2024-05-13T05:17:48.935Z"),
y: 1,
},
{
x: new Date("2024-05-13T05:24:55.960Z"),
y: 1,
},
{
x: new Date("2024-05-13T05:28:05.822Z"),
y: 1,
},
{
x: new...