Empty graph initially

When my page loads a graph appears but it is empty. The data does not appear until I double click on the graphing area.
Is there a way make sure the graph is showing without having to click on the graph?

My steps in JS are:

  1. Collect data and store into arrays
  2. plotly.plot using html id and arrays

My steps in HTML are:

  1. in header, include the plotly file
  2. in the body, create empty div with id
  3. in the body, run the JS code