Skip to content

[Bug] 当使用dataset时,markline会报错 #21415

Closed

Description

@tlbb764652810

Version

6.0

Link to Minimal Reproduction

https://echarts.apache.org/examples/zh/editor.html?c=line-simple&code=XZKxbsIwEIZ3nuK2LBGKQ0ISqg4tW0XVpVIHxOCaE0QQGzkOBVXMfYo-Rad26dOgvkZtJwbDDZZ99_nu953FRpWCwy289wDmVNEa1cgeAGrRSIYjmNoTwDSomZAYhBDQSjRcmd1GinnDVDALHZUX_UEIaR6TWMcfqWJLChOqFHpQmvVJCFkep4mByvUKnpF6QJb0dSQh0cBkGS8Ra4SxYMKH0shkIXGWpmfoXoo3XvrFtKIshDgiicE6Rde5hrlVVJBkqKFLMaToa2dB8tSIeZKULxAempL5VUhkIBJ11AQr3dhraBB3UmxzXuiaN-qs2FJmPZgLu7tdWethgNpv9BgCRhUuhNwHbXjfhe2lDtnSdYOBS1CjLFEj7QBb8IS-Uhk4WciZmGunQ3RtTbjROkqX1N5u9J3P1jFWUbmalPwiiflP5-_ja2iN08ooOX5_HT8__n5-vUqeULpFSRf2Vc4Op33bMucx66x3uPkH&enc=deflate

Steps to Reproduce

好用的例子如下

option = {
  xAxis: {
    type: 'category',
    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  },
  yAxis: {
    type: 'value'
  },
  series: [
    {
      data: [150, 230, 224, 218, 135, 147, 260],
      type: 'bar',
      markLine: {
        data: [{
            name: '平均线',
            // 支持 'average', 'min', 'max'
            type: 'average'
        }]
      }
    }
  ]
};

不好用的例子如下

option = {
  dataset: {
    source: [
      ['score', 'amount', 'product'],
      [89.3, 58212, 'Matcha Latte'],
      [57.1, 78254, 'Milk Tea'],
      [74.4, 41032, 'Cheese Cocoa'],
      [50.1, 12755, 'Cheese Brownie'],
      [89.7, 20145, 'Matcha Cocoa'],
      [68.1, 79146, 'Tea'],
      [19.6, 91852, 'Orange Juice'],
      [10.6, 101852, 'Lemon Juice'],
      [32.7, 20112, 'Walnut Brownie']
    ]
  },
  xAxis: {type: 'category'},
  yAxis: {
    type: 'value'
  },
  series: [
    {
      type: 'bar',
      encode: {
        x: 'product',
        y: 'amount'
      },
      markLine: {
        data: [{
            name: '平均线',
            type: 'average'
        }]
      }
    }
  ]
};

Current Behavior

不好用的例子加载报错

Expected Behavior

Image

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

之前v5的版本是好用的

Activity

  1. added
    pending
    on Dec 8, 2025
  2. echarts-bot commented on Dec 8, 2025

    @echarts-bot

    @tlbb764652810 It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗

    TRANSLATED

    TITLE

    [Bug] When using dataset, markline will report an error

  3. helgasoft commented on Dec 8, 2025

    @helgasoft

    duplicate of #21300
    This "ordinalMeta" bug 🐛 seems related to column positions inside dataset.source.
    It is triggered when the number of columns is >=3 AND the X-axis column position is >=3 :
    Demo.

  4. added and removed
    pending
    on Dec 20, 2025
  5. added this to the 6.x milestone on Dec 20, 2025
  6. plainheart commented on Dec 20, 2025

    @plainheart
    Member

    Thanks for your report. It seems this bug was introduced in #20682 and this is working in v5.

    Relevant code snippet: https://github.com/apache/echarts/blob/6.0.0/src/data/SeriesData.ts#L321-L323

  7. added
    regression
    on Dec 20, 2025
  8. modified the milestones: 6.x, 6.1.0 on Dec 20, 2025
  9. 100pah commented on Dec 21, 2025

    @100pah
    Member

    Fixed in #21439

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugregressiontopic: datasettopic: marker

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions