[Echarts] 定制每条线上小圆点(symbol)大小(symbolSize)

117 阅读1分钟
export function genSeries(name, data, color) {
  let currentUTCHour = new Date().getUTCHours()
  let item = {
    name: name,
    type: 'line',
    showSymbol: true,
    data: data, // 每一条线上面的数据
    //   symbolSize: 3,

    symbolSize: function (value, params) {
        return 0
      //   if (params.dataIndex % 3 === 0) {
      //       return 3
      //   } else {
      //       return 0
      //   }
    },
    lineStyle: {
        normal: {
            // width: 1,
            // type: 'solid' // solid or dotted
            color: color,
        }
    },
    itemStyle: {
        normal: {
            color: color
        }
    },
  }
  return item
}