pyechars简单绘制主题河流
from pyecharts.charts import ThemeRiver
import pyecharts.options as opts
import pandas as pd
data = pd.read_csv('river_data.csv')
data_list = []
for i in zip(data['date'],data['num'],data['series']):
data_list.append(list(i))
series = ['分支1','分支2','分支3','分支4','分支5','分支6']
wc = ThemeRiver(init_opts=opts.InitOpts(height='600px'))\
.add(series_name=series, data=data_list, singleaxis_opts=opts.SingleAxisOpts(type_='time'))\
.render()
结果图
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/749a65be1f69846bf885a064e3995f2e.png#pic_center)
数据
date,num,series
2015/11/8,10,分支1
2015/11/9,15,分支1
2015/11/10,35,分支1
2015/11/14,7,分支1
2015/11/15,2,分支1
2015/11/16,17,分支1
2015/11/17,33,分支1
2015/11/18,40,分支1
2015/11/19,32,分支1
2015/11/20,26,分支1
2015/11/21,35,分支1
2015/11/22,40,分支1
2015/11/23,32,分支1
2015/11/24,26,分支1
2015/11/25,22,分支1
2015/11/8,35,分支2
2015/11/9,36,分支2
2015/11/10,37,分支2
2015/11/11,22,分支2
2015/11/12,24,分支2
2015/11/13,26,分支2
2015/11/14,34,分支2
2015/11/15,21,分支2
2015/11/16,18,分支2
2015/11/17,45,分支2
2015/11/18,32,分支2
2015/11/19,35,分支2
2015/11/20,30,分支2
2015/11/21,28,分支2
2015/11/22,27,分支2
2015/11/23,26,分支2
2015/11/24,15,分支2
2015/11/25,30,分支2
2015/11/26,35,分支2
2015/11/27,42,分支2
2015/11/28,42,分支2
2015/11/8,21,分支3
2015/11/9,25,分支3
2015/11/10,27,分支3
2015/11/11,23,分支3
2015/11/12,24,分支3
2015/11/13,21,分支3
2015/11/14,35,分支3
2015/11/15,39,分支3
2015/11/16,40,分支3
2015/11/17,36,分支3
2015/11/18,33,分支3
2015/11/19,43,分支3
2015/11/20,40,分支3
2015/11/21,34,分支3
2015/11/22,28,分支3
2015/11/14,7,分支4
2015/11/15,2,分支4
2015/11/16,17,分支4
2015/11/17,33,分支4
2015/11/18,40,分支4
2015/11/19,32,分支4
2015/11/20,26,分支4
2015/11/21,35,分支4
2015/11/22,40,分支4
2015/11/23,32,分支4
2015/11/24,26,分支4
2015/11/25,22,分支4
2015/11/26,16,分支4
2015/11/27,22,分支4
2015/11/28,10,分支4
2015/11/8,10,分支5
2015/11/9,15,分支5
2015/11/10,35,分支5
2015/11/11,38,分支5
2015/11/12,22,分支5
2015/11/13,16,分支5
2015/11/14,7,分支5
2015/11/15,2,分支5
2015/11/16,17,分支5
2015/11/17,33,分支5
2015/11/18,40,分支5
2015/11/19,32,分支5
2015/11/20,26,分支5
2015/11/21,35,分支5
2015/11/22,4,分支5
2015/11/23,32,分支5
2015/11/24,26,分支5
2015/11/25,22,分支5
2015/11/26,16,分支5
2015/11/27,22,分支5
2015/11/28,10,分支5
2015/11/8,10,分支6
2015/11/9,15,分支6
2015/11/10,35,分支6
2015/11/11,38,分支6
2015/11/12,22,分支6
2015/11/13,16,分支6
2015/11/14,7,分支6
2015/11/15,2,分支6
2015/11/16,17,分支6
2015/11/17,33,分支6
2015/11/18,4,分支6
2015/11/19,32,分支6
2015/11/20,26,分支6
2015/11/21,35,分支6
2015/11/22,40,分支6
2015/11/23,32,分支6
2015/11/24,26,分支6
2015/11/25,22,分支6