echarts的markline自定义起始位置和终点位置

let markPoint = [10,20];

markLine: {
              symbol: ["none", "none"], // 去掉箭头
              silent: true,
              label: {
                show: true,
                formatter: "{b}",
                offset: [-100, -6],
              },
              lineStyle: {
                type: "dashed",
                color: "rgb(1, 246, 234)"
              },
              data: [
                [
                  {coord: [this.markPoint[0], 0]},
                  {coord: [this.markPoint[0], this.markPoint[1]]}
                ],
                [
                  {coord: [0, this.markPoint[1]]},
                  {coord: [this.markPoint[0], this.markPoint[1]]}
                ],
              ]
            }

posted @ 2024-07-23 11:07  _seven7  阅读(1750)  评论(0)    收藏  举报