Closed qiuxh66 closed 1 year ago
源程序如下,可直接运行 import pyecharts from pyecharts.charts import Line from pyecharts import options as opts
x = list(range(0, 10)) y1 = [i * 2 + 1 for i in list(range(0, 10))]
y3 = [(i+1)/10 * 3 for i in list(range(0, 10))]
line = ( Line() .add_xaxis(x) .add_yaxis("y1", y1 ,color="green",is_symbol_show=True #第一轴设置为绿色 ,label_opts=opts.LabelOpts(is_show=False) ) .extend_axis(yaxis=opts.AxisOpts( name="y3")) .set_global_opts(title_opts=opts.TitleOpts(title="双坐标轴Demo",pos_right="50%") # 设置标题 ,legend_opts=opts.LegendOpts(pos_right="10%",pos_top="50%",orient="vertical") # 设置图例 ,tooltip_opts =opts.TooltipOpts(trigger='axis',axis_pointer_type='cross')
,xaxis_opts =opts.AxisOpts(name="X") ,yaxis_opts =opts.AxisOpts(name="Y") )
) line1 = (Line() .add_xaxis(x) .add_yaxis("y3", y3 ,color="blue",is_symbol_show=True #第二轴想设置为蓝色,但是图中是红色了,不知为何? ,label_opts=opts.LabelOpts(is_show=False) , yaxis_index=1)) line.overlap(line1) line.render_notebook()
截图不会放。 开发大大帮忙看看,github速度超慢,请邮件:qxh66@126.com
源程序如下,可直接运行 import pyecharts from pyecharts.charts import Line from pyecharts import options as opts
x = list(range(0, 10)) y1 = [i * 2 + 1 for i in list(range(0, 10))]
y2 = [i * 3 + 2 for i in list(range(0, 10))]
y3 = [(i+1)/10 * 3 for i in list(range(0, 10))]
line = ( Line() .add_xaxis(x) .add_yaxis("y1", y1 ,color="green",is_symbol_show=True #第一轴设置为绿色 ,label_opts=opts.LabelOpts(is_show=False) ) .extend_axis(yaxis=opts.AxisOpts( name="y3")) .set_global_opts(title_opts=opts.TitleOpts(title="双坐标轴Demo",pos_right="50%") # 设置标题 ,legend_opts=opts.LegendOpts(pos_right="10%",pos_top="50%",orient="vertical") # 设置图例 ,tooltip_opts =opts.TooltipOpts(trigger='axis',axis_pointer_type='cross')
,toolbox_opts =opts.ToolboxOpts(is_show=True,orient='horizontal')
) line1 = (Line() .add_xaxis(x) .add_yaxis("y3", y3 ,color="blue",is_symbol_show=True #第二轴想设置为蓝色,但是图中是红色了,不知为何? ,label_opts=opts.LabelOpts(is_show=False) , yaxis_index=1)) line.overlap(line1) line.render_notebook()
截图不会放。 开发大大帮忙看看,github速度超慢,请邮件:qxh66@126.com