Hello,
Kind of a newbie question but I have not been able to find the proper answer. Instead of having the hover label, I was trying to find a way to show labels in each county Polygon. I have the following code:
init_notebook_mode()
data=pd.read_excel(âAZ Sales by FIPS.xlsxâ, dtype={âFIPSâ:object})
df_sample_r = data[data[âStateâ] == âAZâ]
values = df_sample_r[âSalesâ].tolist()
fips = df_sample_r[âFIPSâ].tolist()
colorscale = [
ârgb(193, 193, 193)â,
ârgb(239,239,239)â,
ârgb(195, 196, 222)â,
ârgb(144,148,194)â,
ârgb(101,104,168)â,
ârgb(65, 53, 132)â
]
fig = ff.create_choropleth(
fips=fips, values=values, scope=[âAZâ],
binning_endpoints=[1, 4, 7, 10, 13], colorscale=colorscale,
county_outline={âcolorâ: ârgb(0,0,0)â, âwidthâ: 1.0}, round_legend_values=True,
legend_title=âSales by Countyâ, title=âAZâ
)
iplot(fig, filename=âchoropleth_arizonaâ)
Thank you,
Justin