效果展示
Python代码
import json
from pyecharts import Pie
f = open('pies.json', encoding='gbk')
data = json.load(f)
print(data)
name = data['name']
sales = data['sales']
sales_volume = data['sales_volume']
print(name, sales, sales_volume)
pie = Pie('', width=800)
pie.add('', name, sales, sales_volume, is_label_show=True)
pie.render('pie.html')
数据文件链接: https://pan.baidu.com/s/1at-o0gfSGszpzZWijD1uEg 密码: if5c