Black Lives Matter. Please consider donating to Black Girls Code today.

Empty graph when loaded

Hi,

I am trying to use plotly with angular 2 and it is showing me an empty bar graph initially and it only shows me the graph when i double click on the graph area.

My code sequence is:

  1. Call api for data to be plotted.
  2. set data x and y variables
  3. plotly.plot

How do I make the graph load after the page loaded without clicking on the graph?

Thanks,

It is working now. My bad of not calling/creating the plot inside my callback function after the data returned from the API.