pyecharts折线图绘制折线不显示

pyecharts折线图绘制折线不显示,求帮忙解决,谢谢
结果图总是这样

img

l=(
Line()
    .add_xaxis([2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022])
    .add_yaxis("次数",[49,34,23,13,20,17,7,18,9,10,18,7],is_smooth=True)
    .set_global_opts(
       title_opts=opts.TitleOpts(title="",
        pos_left='30%', #标题位置
      pos_top='0.1%'),
    legend_opts = opts.LegendOpts(pos_right = '45%',pos_top='5%'),
    tooltip_opts=opts.TooltipOpts(
        is_show=True,
        trigger="axis",
        axis_pointer_type="cross"
    ),
    xaxis_opts=opts.AxisOpts( name ='次数',name_textstyle_opts = opts.TextStyleOpts(font_size = 15),
         type_="category" ,
        axispointer_opts=opts.AxisPointerOpts(is_show=True,
         type_="shadow" )),
    yaxis_opts=opts.AxisOpts( name ='年份',name_textstyle_opts = opts.TextStyleOpts(font_size = 15),
        
    )            
)
)
l.render_notebook()

该回答引用GPTᴼᴾᴱᴺᴬᴵ
根据你提供的代码,可能是因为你没有在代码中指定渲染图表的类型。你需要将 Line() 替换为 Line3D(),并且添加 grid3D_opts 参数来设置图表的三维网格样式。以下是修改后的示例代码:

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

l = (
    Line3D()
    .add(
        "",
        [(2011,49,0),(2012,34,1),(2013,23,2),(2014,13,3),(2015,20,4),(2016,17,5),(2017,7,6),(2018,18,7),(2019,9,8),(2020,10,9),(2021,18,10),(2022,7,11)],
        xaxis3d_opts=opts.Axis3DOpts(
            name='年份',
            type_='value',
            min_=2011,
            max_=2022,
            axislabel_opts=opts.LabelOpts(formatter="{value}年")
        ),
        yaxis3d_opts=opts.Axis3DOpts(
            name='次数',
            type_='value',
            min_=0,
            max_=50,
            axislabel_opts=opts.LabelOpts(formatter="{value}次")
        ),
        zaxis3d_opts=opts.Axis3DOpts(
            name='月份',
            type_='value',
            min_=0,
            max_=12,
            axislabel_opts=opts.LabelOpts(formatter="{value}月")
        ),
        grid3d_opts=opts.Grid3DOpts(
            width=100,
            height=100,
            depth=100,
            rotate_speed=5,
            is_rotate=True,
            is_zoom_show=True,
            linestyle_opts=opts.LineStyleOpts(width=1),
        ),
    )
    .set_global_opts(
        title_opts=opts.TitleOpts(title="", pos_left="30%", pos_top="0.1%"),
        legend_opts=opts.LegendOpts(pos_right="45%", pos_top="5%"),
        tooltip_opts=opts.TooltipOpts(is_show=True, trigger="axis", axis_pointer_type="cross"),
    )
)
l.render_notebook()


此代码将生成一个基本的三维折线图,其中每个数据点表示年份、次数和月份的组合。你可以根据需要更改数据点的值、范围、轴名称和样式。