JSFiddle - React, Tailwind, and code Playground

by aliakseimaniuk

HTML

<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
   <div id="myDiv" style="width: 480px; height: 400px;"><!-- Plotly chart will be drawn inside this DIV --></div>

JavaScript

var data = {
  x: ['2001-01-02', '2001-01-03', '2001-01-04', '2001-01-05', '2001-01-06', '2001-01-07'], 
  y: [1, 4, 9, 16, 25, 36], 
  type: 'scatter',
};

var layout = {
	dragmode: 'select'
}

Plotly.newPlot('myDiv', [data], layout);

var graphDiv = document.getElementById("myDiv");