JSFiddle - React, Tailwind, and code Playground
by jorgebg
HTML
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.plot.ly/plotly-1.54.0.min.js"></script>
</head>
<body>
<div id="plot"></div>
<script type="text/javascript">
const data = [{
"x": ["2020-04-18T10:00:00.000Z", "2020-04-18T11:00:00.000Z", "2020-04-18T12:00:00.000Z", ],
"y": [2.68, 2.42, 2.45],
"type": "scatter",
}];
const shapes = [{
"fillcolor": "#79bc6a",
"layer": "below",
"line": {
"width": 0
},
"opacity": 0.2,
"type": "rect",
"x0": "2020-04-18T10:00:00.000Z",
"x1": "2020-04-18T12:00:00.000Z",
"xref": "x",
"y0": 0,
"y1": 15,
"yref": "y"
}];
Plotly.newPlot("plot", data, {
shapes: shapes,
});
</script>
</body>
</html>