首页 前端知识 echarts X轴Y轴标识线

echarts X轴Y轴标识线

2024-06-20 09:06:04 前端知识 前端哥 428 466 我要收藏

在这里插入图片描述

series: [
    {
    data: [820, 932, 901, 934, 1290, 1330, 1320],
    smooth: true,
    type: "line",
    lineStyle: {
        width: 2,
        color: " rgb(122, 184, 249)",
        type: "solid", //'dotted'虚线 'solid'实线
    },
    symbol: "none", //取消折点圆圈
    markLine: {
        name: "",
        symbol: ["none", "none"], //去掉箭头
        lineStyle: {
            type: "solid",
            color: "rgb(252,13,27)",
        },
        label: {
            show: false, //不展示标识线数字
        },
        data: [{yAxis:934},{xAxis:934}], //这里设置false是隐藏不了的,可以设置为-1
      },
    },
    
  ]

如果要设置成X轴Y轴颜色不同 就要分开写
在这里插入图片描述

series: [
    {
    data: [820, 932, 901, 934, 1290, 1330, 1320],
    smooth: true,
    type: "line",
    lineStyle: {
        width: 2,
        color: " rgb(122, 184, 249)",
        type: "solid", //'dotted'虚线 'solid'实线
    },
    symbol: "none", //取消折点圆圈
    markLine: {
        name: "",
        symbol: ["none", "none"], //去掉箭头
        lineStyle: {
            type: "solid",
            color: "rgb(252,13,27)",
        },
        label: {
            show: false, //不展示标识线数字
        },
        data: [{yAxis:934}], //这里设置false是隐藏不了的,可以设置为-1
      },
    },
    {
      name: "",
      type: "line",
      smooth: false, //关键点,为true是不支持虚线,实线就用true
      symbol: "none", //取消折点圆圈
      markLine: {
          name: "",
          symbol: ["none", "none"], //去掉箭头
          lineStyle: {
              type: "solid",
              color: "rgb(122, 184, 249)",
          },
          label: {
              show: false, //不展示标识线数字
          },
          data: [{xAxis:934}], //这里设置false是隐藏不了的,可以设置为-1
      },
  },
  ]
转载请注明出处或者链接地址:https://www.qianduange.cn//article/12964.html
标签
评论
发布的文章

jQuery 选择器

2024-05-12 00:05:34

Vue中public/assets目录区别

2024-07-02 23:07:29

大家推荐的文章
会员中心 联系我 留言建议 回顶部
复制成功!