pyecharts / pyecharts-gallery

Just use pyecharts to imitate Echarts official example.
https://gallery.pyecharts.org
MIT License
1.19k stars 585 forks source link

MarkLine,小数据无法准确显示 #46

Closed createnewli closed 1 year ago

createnewli commented 3 years ago

MakeLine生成的线,只能精准到0.01,0.005无法区别出来,比如如下的代码Line线设置的是0.025,但实际生成的Line是0.03

import pyecharts.options as opts from pyecharts.charts import Line

x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] y = [0.01, 0.015, 0.025, 0.03, 0.045, 0.023, 0.035, 0.052, 0.043, 0.037] spec = 0.025

line = ( Line() .add_xaxis(xaxis_data=x) .add_yaxis( series_name="A", y_axis=y, is_smooth=True, label_opts=opts.LabelOpts(is_show=False), ) .set_series_opts( markline_opts=opts.MarkLineOpts( symbol="none", label_opts=opts.LabelOpts( is_show=False, ), data=[opts.MarkLineItem(y=spec, name="SPEC")], linestyleopts=opts.LineStyleOpts( type="dotted", color="rgb(208,2,27)", ) ), ) )

line.render("Spec Line.html")

createnewli commented 3 years ago

生成的图形 image