# 导入必要的模块
from pyecharts import options as opts
from pyecharts.charts import Liquid
# 计算比例
ratio = (t5 + t6) / 500.0
# 创建水球图
c = (
Liquid()
.add("l5年之后图书数量比(水球图)", [ratio], center=["50%", "50%"])
.set_global_opts(title_opts=opts.TitleOpts(title="15年之后图书数量比"))
.set_series_opts(label_opts=opts.LabelOpts(formatter="{b}: {c}"))
.set_colors(["#5470C6", "#91CC75", "#EE6666"])
)
# 在 Jupyter Notebook 中显示图表
c.render_notebook()
from pyecharts import options as opts
from pyecharts.charts import Page,WordCloud
from pyecharts.globals import SymbolType
words = [
("四川文艺出版社",cb_1),("万卷出版公司",cb_2),("江苏凤凰文艺出版社",cb_3),
("复旦大学出版社",cb_4),("江苏文艺出版社",cb_5),("中华书局",cb_6),("东方出版社",cb_7)]
c = WordCloud()
c.add("",words,word_size_range = [20,80])
c.set_global_opts(title_opts = opts.TitleOpts(title = "出版社词云图"))
c.render("word_cloud.html")
c.render_notebook()