Skip to content

Conversation

@archiewood
Copy link

@archiewood archiewood commented Jan 23, 2026

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

Currently I believe time axes are "not supported" with stack as mentioned in docs, which would make this a new feature. But also this has been reported as a bug several times.

What does this PR do?

Supports using "stack" for time-based charts

Fixed issues

Details

Before: What was the problem?

Using stack with time axes does work in many cases today.

But if you attempted to use stack with time axes, and the series are not in the same order, then the stacks will render incorrectly. The stacked series will use the index to determine the start position, not the time.

Reproduction

CleanShot 2026-01-23 at 16 28 58@2x

After: How does it behave after the fixing?

The stacks will look up the stack using the time value instead of the index

CleanShot 2026-01-23 at 16 30 11@2x

Document Info

One of the following should be checked.

  • This PR doesn't relate to document changes
  • The document should be updated later
  • The document changes have been made in apache/echarts-doc#xxx

Misc

Security Checking

  • This PR uses security-sensitive Web APIs.

ZRender Changes

  • This PR depends on ZRender changes (ecomfe/zrender#xxx).

Related test cases or examples to use the new APIs

let option={
  "xAxis": {
    "type": "time"
  },
  "series": [
    {
      "name": "A",
      "type": "bar",
      "data": [
        ["2025-01-01",4],
        ["2025-02-01",8]
      ],
      "stack": "stack1"
    },
    {
      "name": "B",
      "type": "bar",
      "data": [
        ["2025-02-01",3],
        ["2025-01-01",9,]
      ],
      "stack": "stack1",
    }
  ],
  "yAxis": [
    {
      "type": "value"
    }
  ]
}

Merging options

  • Please squash the commits into a single one when merging.

Other information

@echarts-bot echarts-bot bot added PR: awaiting doc Document changes is required for this PR. PR: awaiting review labels Jan 23, 2026
@echarts-bot
Copy link

echarts-bot bot commented Jan 23, 2026

Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.

Please DO NOT commit the files in dist, i18n, and ssr/client/dist folders in a non-release pull request. These folders are for release use only.

Document changes are required in this PR. Please also make a PR to apache/echarts-doc for document changes and update the issue id in the PR description. When the doc PR is merged, the maintainers will remove the PR: awaiting doc label.

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

Labels

PR: awaiting doc Document changes is required for this PR. PR: awaiting review size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant