[ad_1]
I am trying to plot using Rest API in Django with the help of plotly but I am not able to plot.
for repo_info in repositories:
repo_names.append(repo_info['MeterReading_DateTime'])
repo_stars.append(repo_info['ACT_IMP_TOT'])
data_plots = [{'type' : 'bar', 'x':repo_names , 'y': repo_stars}]
layout = {'title': 'MDM Data','xaxis': {'title': 'Date and time'},'yaxis': {'title': 'Total Import'}}
fig = {'data': data_plots, 'layout': layout}
#offline.plot(fig, filename="Most_Popular_JavaScript_Repos.html")
return render(request, "index.html", context={'fig': fig})
[ad_2]