Skip to content

[Bug] 矩阵图matrix.y.label格式化无效?The x and y label formatting of the matrix diagram is invalid? #21403

@leekbillow

Description

@leekbillow

Version

6.0.0

Link to Minimal Reproduction

https://echarts.apache.org/examples/zh/editor.html?c=matrix-correlation-heatmap

Steps to Reproduce

  1. open 官方示例
  2. add matrix.y.label

Current Behavior

官方示例,其它未作改动,仅添加label: { formatter: 'test' }不生效
Official example, nothing else has been changed, add only label: { formatter: 'test' }

Image
const xCnt = 8;
const yCnt = xCnt;
const xData = [];
const yData = [];
for (let i = 0; i < xCnt; ++i) {
  xData.push({
    value: 'X' + (i + 1)
  });
}
for (let i = 0; i < yCnt; ++i) {
  yData.push({
    value: 'Y' + (i + 1)
  });
}
const data = [];
for (let i = 1; i <= xCnt; ++i) {
  for (let j = 1; j <= yCnt; ++j) {
    if (i >= j) {
      data.push(['X' + i, 'Y' + j, i === j ? 1 : Math.random() * 2 - 1]);
    }
  }
}
option = {
  matrix: {
    x: {
      data: xData
    },
    y: {
      data: yData,
      label: {
        formatter: 'test'
      }
    },
    top: 80
  },
  visualMap: {
    type: 'continuous',
    min: -1,
    max: 1,
    dimension: 2,
    calculable: true,
    orient: 'horizontal',
    top: 5,
    left: 'center'
  },
  series: {
    type: 'heatmap',
    coordinateSystem: 'matrix',
    data,
    label: {
      show: true,
      formatter: (params) => params.value[2].toFixed(2)
    }
  }
};

Expected Behavior

matrix.y.label生效(take effect)

Environment

- OS: Windows 11
- Browser: Chrome 142.0.7444.177
- Framework: echarts example

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpendingWe are not sure about whether this is a bug/new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions