JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/plotly.js/2.26.0/plotly.min.js"></script>
<head>
<!-- Plotly.js -->
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
</head>
<body>
<div id="myDiv" style="width: 480px; height: 400px;"><!-- Plotly chart will be drawn inside this DIV --></div>
<script>
<!-- JAVASCRIPT CODE GOES HERE -->
</script>
</body>
JavaScript
/* import Plot from 'plotly.js'; */
const data1 = {
"x": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
],
"y": [
21.27995506330533,
0.0000029584322041672694,
0,
10.965155603209313,
90.3225806451613,
77.41935483870968,
57.41849223487945,
5.150919846808659,
0,
0,
0,
0,
0,
0.0000014792161012161067,
3.225806451612903,
9.67741935483871,
54.50705616027165,
100,
100,
100,
100,
96.7741935483871,
80.9638550409915,
51.61290322580645,
],
"name": "Trace 1",
"stackgroup": "1",
"marker": {
"color": "#ff860d"
},
"visible": "legendonly"
}
const data2 = {
"x": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
],
"y": [
-46.24295906376967,
-63.8030124705526,
-80.64516129032258,
-39.791344516725836,
0,
0,
-27.969797314371707,
-74.2031523826191,
-96.42003996500563,
-96.7741935483871,
-96.7741935483871,
-97.8510627575421,
-96.7741935483871,
-96.7741935483871,
-82.46395740393189,
-43.045971173996044,
0,
0,
0,
0,
0,
-3.225806451612903,
-6.451612903225806,
-16.856545772054012,
],
"name": "Trace 2",
"stackgroup": "1",
"marker": {
"color": "#3abb4d"
},
"visible":...