<head>
  <script src="https://cdn.plot.ly/plotly-2.32.0.min.js" charset="utf-8"></script>
</head>
<html>
  <body>
    <div id="myDiv"></div>
  </body>
</html>
var trace1 = {
  x: [0, 1, 2, 3, 4, 5, 6, 7, 8],
  y: [0, 1, 2, 3, 4, 5, 6, 7, 8],
  xaxis: "x",
  yaxis: "y2",
  type: 'scatter'
};
var trace2 = {
  x: [0, 1, 2, 3, 4, 5, 6, 7, 8],
  y: [1, 0, 3, 2, 5, 4, 7, 6, 8],
  xaxis: "x",
  yaxis: "y2",
  type: 'scatter'
};
var trace3 = {
  x: [0],
  y: [0],
  xaxis: "x",
  yaxis: "y",
  type: 'scatter'
};
var data = [trace1, trace2, trace3];
var layout = {
  showlegend: false,
  xaxis: {
    anchor: "y2"
  },
  yaxis: {
    visible: true,
    ticksuffix: "%",
    range: [0,100]
  },
  yaxis2: {
    visible: false,
    overlaying: "y",
    scaleanchor: "y1"
  }
};

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

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.