行业知识
大数据可视化010
2026-10-26 20:24:17
来源:互联网转载
from pyecharts.charts import Liquid, Gridfrom pyecharts import options as optsdata = [0.475]# 创建第一个液体图表tu1 = ( Liquid(init_opts=opts.InitOpts(width="900px", height="600px")) .add("", data, is_outline_show=False, color=["white"], background_color="yellow", center=["20%","50%"], shape='arrow') .set_global_opts( title_opts=opts.TitleOpts( , pos_left='5%', title_textstyle_opts=opts.TextStyleOpts(font_size=50) ) ))# 创建第二个液体图表tu2 = ( Liquid(init_opts=opts.InitOpts(width="900px", height="600px")) .add("", data, is_outline_show=False, color=["white"], background_color="red", center=["80%","50%"], shape='arrow') .set_global_opts( title_opts=opts.TitleOpts( , pos_right='5%', title_textstyle_opts=opts.TextStyleOpts(font_size=50) ) ))# 将两个图表放置在网格中grid = ( Grid(init_opts=opts.InitOpts(width="900px", height="600px")) .add(tu1, grid_opts=opts.GridOpts(pos_right='25%')) .add(tu2, grid_opts=opts.GridOpts(pos_left='75%')) )# 在 Jupyter Notebook 中渲染网格grid.render_notebook()()()