全国药店药品销售额占比
药品类型 | 占比(%) |
化学药 | 33 |
中成药 | 45 |
生物制品 | 3 |
保健品 | 9 |
中药饮片 | 6 |
其他 | 4 |
饼图
import pyecharts.options as opts
from pyecharts.charts import Pie
a=(
Pie()
# 添加数据
.add("",[('化学药',33),('中成药',45),('生物制片',3),('保健品',9),('中药饮片',6),('其他',4)])
# 设置标题
.set_global_opts(title_opts=opts.TitleOpts(title='饼图示例'))
)
a.render_notebook()
运行结果
环图
import pyecharts.options as opts
from pyecharts.charts import Pie
a=(
Pie()
# 添加数据
.add("",[('化学药',33),('中成药',45),('生物制片',3),('保健品',9),('中药饮片',6),('其他',4)],
center=["50%","50%"],radius=[100,160] )
#center 表述饼图的中心位置,一项表示左右,一项表示上下
#radius表示饼图的半径,可以接受一个包含两个元素的数组,第一项数组为内径,第二项数组为外径
# 设置标题
.set_global_opts(title_opts=opts.TitleOpts(title='全国药店药品销售额比例',subtitle='用于反映中药市场趋势'))
#subtitle表示副标题
)
a.render_notebook()