下图,让x高亮显示

方法一:设置x轴的axisLabel

xAxis:   {
 axisLabel: {
              show: true,
              textStyle: {
                color: function (value, index) {
                  return _this.axisValue !== "" && _this.axisValue === value
                    ? "red"
                    : "#666666";
                },
              },
              interval: 0,
            },
}

方法二:设置tooltipaxisPointer

  tooltip: {
      trigger: 'axis',
      axisPointer: {
        label: {
          show: true,
          backgroundColor: '#fff',
          color: 'red',
          borderColor: 'rgba(0,0,0,0)',
          shadowColor: 'rgba(0,0,0,0)',
          shadowOffsetY: 0,
        },
        lineStyle: {
          width: 0,
        },
      },
}

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注