from pyecharts.charts import Liquid, Grid from pyecharts import options as opts data = [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( title="内存使用率1", 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( title="CPU使用率", 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()
转载请注明来自码农世界,本文标题:《大数据可视化010》
百度分享代码,如果开启HTTPS请参考李洋个人博客
还没有评论,来说两句吧...