日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學(xué)無先后,達(dá)者為師

網(wǎng)站首頁 編程語言 正文

Python可視化神器pyecharts繪制水球圖_python

作者:王小王_123??????? ? 更新時間: 2022-08-29 編程語言

水球圖

水球圖首先是動態(tài)的效果,像水流一樣波動,所以看起來比較的舒服,一般用于業(yè)務(wù)里面的完成率,其實(shí)和之前的儀表盤有點(diǎn)類似,但是我個人絕對水球圖更加的好,因?yàn)榭雌饋肀容^的炫酷。

from pyecharts import options as opts
from pyecharts.charts import Liquid
from pyecharts.globals import SymbolType

c = (
Liquid()
.add("完成", [0.7, 0.3], is_outline_show=False, shape=SymbolType.DIAMOND)
.set_global_opts(title_opts=opts.TitleOpts(title="業(yè)務(wù)完成率"))
.render("菱形水球圖.html")
)

雙水球圖顯示

from pyecharts import options as opts
from pyecharts.charts import Grid, Liquid
from pyecharts.commons.utils import JsCode
l1 = (
Liquid()
.add("lq", [0.6, 0.7], center=["60%", "50%"])
.set_global_opts(title_opts=opts.TitleOpts(title="標(biāo)題"))
)
l2 = Liquid().add(
"lq",
[0.3],
center=["25%", "50%"],
label_opts=opts.LabelOpts(
font_size=50,
formatter=JsCode(
"""function (param) {
return (Math.floor(param.value * 10000) / 100) + '%';
}"""
),
position="inside",
),
)
grid = Grid().add(l1, grid_opts=opts.GridOpts()).add(l2, grid_opts=opts.GridOpts())
grid.render("雙水球圖顯示.html")

正方形水球圖

其實(shí)只需要變動一下參數(shù)即可,和最開始的那個差不多。

from pyecharts import options as opts
from pyecharts.charts import Liquid
from pyecharts.globals import SymbolType
c = (
Liquid()
.add("lq", [0.7, 0.7], is_outline_show=False, shape=SymbolType.RECT)
.set_global_opts(title_opts=opts.TitleOpts(title="標(biāo)題"))
.render("正方形.html")
)

圓球水球圖

from pyecharts import options as opts
from pyecharts.charts import Liquid
c = (
Liquid()
.add("lq", [0.7, 0.7])
.set_global_opts(title_opts=opts.TitleOpts(title="圓球"))
.render("圓球.html")
)

?數(shù)據(jù)精度水球圖

from pyecharts import options as opts
from pyecharts.charts import Liquid
from pyecharts.commons.utils import JsCode

c = (
Liquid()
.add(
"lq",
[0.3254],
label_opts=opts.LabelOpts(
font_size=50,
formatter=JsCode(
"""function (param) {
return (Math.floor(param.value * 10000) / 100) + '%';
}"""
),
position="inside",
),
)
.set_global_opts(title_opts=opts.TitleOpts(title="標(biāo)題"))
.render("數(shù)據(jù)精度水球圖.html")
)

炫酷水球超級好看

感覺這個顏色搭配還是不錯的

from pyecharts import options as opts
from pyecharts.charts import Liquid
c = (
Liquid()
.add("lq", [0.6, 0.7, 0.8], is_outline_show=False)
.set_global_opts(title_opts=opts.TitleOpts(title="標(biāo)題"))
.render("無邊框水球圖.html")
)

原文鏈接:https://blog.51cto.com/u_15172991/5428188

欄目分類
最近更新