JSFiddle - React, Tailwind, and code Playground

by Nayana Das

HTML

<head>
	<!-- Load plotly.js into the DOM -->
	<script src='https://cdn.plot.ly/plotly-latest.min.js'></script>
</head>

<body>
	<div id='myDiv'><!-- Plotly chart will be drawn inside this DIV --></div>
</body>

JavaScript

var data = [{"x":[],"y":[],"name":"riviera-demo","type":"bar"},{"x":[],"y":[],"name":"soham-demo","type":"bar"}, {"x":[],"y":[],"name":"test-demo","type":"bar"},
{"x":[],"y":[],"name":"test-demo","type":"bar"}, {"x":[],"y":[],"name":"test-demo","type":"bar"}];

var layout = {
  barmode: 'stack',
  showlegend: true,
};

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