JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<div id="graph1"></div>
JavaScript
const x = [];
const y = [];
for(let i = 1; i < 8; i++)
{
x.push(new Date(2017, 10, i));
y.push(Math.floor(Math.random() * 10000));
}
Plotly.plot(
document.getElementById('graph1'),
[
{
x: x,
y: y,
type: 'scatter',
text: y,
fill: 'tonexty',
mode: 'lines+markers+text',
textposition: 'top'
}
],
{
}, { staticPlot: true }
);