Skip to content
Advertisement

TypeError when plotting multiple scatter graphs?

I am having an issue when trying to plot scatter graphs. I am using Tiingo Api to get stock data and have plotted 4 separate histograms for my data with no issue (code below)

JavaScript

However when I run this code to try to do something similar with a scatter graph I get a TypeError: no numerical data to plot, although I have defined the data to plot?

JavaScript

I was expecting four similar graphs as with the histograms but I got the TypeError.

Why is that and how can I fix it?

Advertisement

Answer

I can’t replicate your pdf.tiingo… line so I can’t be absolutely certain, but I suspect your dates are not actually datetimes.

Try something like:

JavaScript

See if that fixes it. If not, please report back.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement