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

WARN: Calling Plotly.plot as if redrawing but this container doesn't yet have a plot

Hi folks
I’m new to plotly and it’s great, but I can’t figure out how to loop through an array and make a new chart for each array item… can someone tell me where I’m going wrong?
This is called on ajaxStop. The first plot of the combined data on one chart draws perfectly, but I also want to show the array data separately…

spiMap.drawPlotly = function()
	var tsGraph = document.getElementById('plotlyAllDiv');
	Plotly.plot(tsGraph, spiMap.tsChartData);
	if(spiMap.tsChartData.length > 0)
		for(var i = 0; i<spiMap.tsChartData.length; i++)
			var data = spiMap.tsChartData[i];
			$('#graphContainer').append('<div id="plotlyDiv'+i+'" class="chartContainer"></div>');
			var plotlyGraph = document.getElementById('plotlyDiv'+i);
			Plotly.newPlot(plotlyGraph, data);

Edit apparently I needed to put the data in an array…
Plotly.newPlot(plotlyGraph, [data]);