Skip to content
Advertisement

Returning figure in Plotly Dash

I have the following code that should plot a graph. But, it’s coming up blank.

JavaScript

The html component code for the same is:

JavaScript

This is the first time I am trying to plot a line graph using add_trace in Dash. I have plotted other graphs using

JavaScript

or something similar. But that is not working for this code. Please guide me. Thank you!

Here’s the full code for the app:

JavaScript

I have used the JHU based Coronavirus dataset available here: https://github.com/RamiKrispin/coronavirus-csv

And my analysis and data manipulation for reference is here (No Dash code here): https://www.kaggle.com/sandeshpatkar/coronavirus-worldwide-cases-analysis

Advertisement

Answer

There seems to be a small typo as you wrote df = qq[qq['country'] == country] while you probably meant df = df[df['country'] == country]. If you replace qq with df the app works as expected.

Advertisement