def get_city_phase():
city_pahse = pd.crosstab(frame.city,frame.phase,margins=True).sort_values(by='All',ascending=False)[:11]
city_pahse = city_pahse.drop('All',axis=0).drop('All',axis=1)
funnel_chart = pygal.StackedBar()
funnel_chart.title = u'??????????????'
funnel_chart.x_labels = city_pahse.index
for i in range(len(list(city_pahse.T.index))):
funnel_chart.add(city_pahse.T.index[i], city_pahse.T.values[i])
funnel_chart.render_to_file(os.path.dirname(__file__)+'/chart/phase.svg')
评论列表
文章目录