<!-- Load plotly.js into the DOM -->

<head>
  <script src="https://cdn.plot.ly/plotly-2.14.0.min.js"></script>
</head>
<!--<script src='https://cdn.plot.ly/plotly-2.2.0.min.js'></script> -->

<body>
  <div id='myDiv'>
    <!-- Plotly chart will be drawn inside this DIV -->
  </div>
</body>
const xxx = [];
let yyy = [];
const data = [];

function getRandomInt(max) {
  return Math.floor(Math.random() * max);
}

for (let i = 1; i < 8761; i++) {
  xxx.push(i);
}

for (let k = 0; k < 16; k++) {
  for (let i = 1; i < 8760; i++) {
    yyy.push(getRandomInt(i));
  }
  let name = String(k).concat("trace");
  data.push({
    x: xxx,
    y: yyy,
    name: name,
    type: "bar"
  });
  yyy = [];
}

var layout = {
  xaxis: { title: "X axis", range: [1, 8760] },
  yaxis: { title: "Y axis" },
  barmode: "relative",
  bargap: 0,
  title: "Relative Barmode"
};

console.log(data);
console.log(layout);
Plotly.react("myDiv", data, layout);

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.