底下可以繪製出汽車儀錶板
from pyecharts import options as opts from pyecharts.charts import Gauge dashboard = ( Gauge() .add( series_name="当前车速", data_pair=[("", 88)], min_=0, max_=240, split_number=12, # 当前时速为88, 最低0km/h 最高 240km/h, 分为12段 detail_label_opts=opts.LabelOpts(formatter="{value}km/h"), # 显示格式 axisline_opts=opts.AxisLineOpts( linestyle_opts=opts.LineStyleOpts( color=[(0.83, "#37a2da"), (1, "red")], width=20 # 超过240km/h的0.83后,仪表板变成红色,以警示 ) ), ) .set_global_opts( title_opts=opts.TitleOpts(title="汽车仪表盘"), legend_opts=opts.LegendOpts(is_show=False), ) ) # 使图像在notebook显示 #dashboard.render_notebook() dashboard.render()
todo
http://www.feiguyunai.com/?s=%E7%AC%AC5%E7%AB%A0