echarts scatter chart markline connects multiple points

A rendering

Two codes

MarkLine is an array format lineStyle can modify the color of the line

{
            type: 'scatter',
            symbolSize: 6,
            label: {
              show: true,
              position: 'insideTop',
              fontSize: 14,
              lineHeight: 16,
              fontWeight: 700,
            },
            markLine: {
              silent: true, // 鼠标悬停事件, true悬停不会出现实线
              symbol: 'none', // 去掉箭头
              data: [
                [
                  { 
                    coord: [-12, -9],
                    lineStyle: {
                      width: 1,
                      type: 'solid',
                      color: '#3E3E3E',
                    },
                  },
                  { 
                    coord: [-12, 2],
                    lineStyle: {
                      width: 1,
                      type: 'solid',
                      color: '#3E3E3E',
                    },
                  }
                ],
                [
                  { 
                    coord: [-12, -9],
                    lineStyle: {
                      width: 1,
                      type: 'solid',
                      color: '#3E3E3E',
                    },
                  },
                  { 
                    coord: [-4, -2],
                    lineStyle: {
                      width: 1,
                      type: 'solid',
                      color: '#3E3E3E',
                    },
                  }
                ]
              ]
            },
            data: dt.data,
          },

 

Guess you like

Origin blog.csdn.net/sunnyboysix/article/details/114266765
Recommended