data=pd.json_normalize(payload['data'])
selected=data[["datetext", "counttext","location.formattedAddress"]]
print(selected)
pivoted = pd.DataFrame(selected.pivot_table(values='counttext', index='datetext', columns='location.formattedAddress', aggfunc='sum'))
#pivoted = pivoted.set_index('datetext')
print(list(pivoted.columns.values))
#print(pivoted)
# figure size globally set for matplotlib
mpl.rcParams['figure.figsize'] = (20, 20)
mpl.rcParams['axes.grid'] = False
ax = pivoted.plot()
#ax.set_color_palette(sns.color_palette("muted"))
pivoted.plot(ax=ax)
plt.legend(loc='best',prop={'size': 6})
plt.show()