echarts icon indicating copy to clipboard operation
echarts copied to clipboard

fix(parallel): calculate axis extent after processing series extents

Open jackhickson opened this issue 3 months ago • 2 comments

Brief Information

This pull request is in the type of:

  • [X] bug fixing
  • [ ] new feature
  • [ ] others

What does this PR do?

Calculate the correct axis extent for parallel axes when any series after the first has a larger value than the first series.

demo

option = {
  parallelAxis: [
    { dim: 0, name: 'Price' },
    { dim: 1, name: 'Net Weight' },
    { dim: 2, name: 'Amount' },
    {
      dim: 3,
      name: 'Score',
      type: 'category',
      data: ['Excellent', 'Good', 'OK', 'Bad']
    }
  ],
  series: [{
    type: 'parallel',
    lineStyle: {
      width: 4
    },
    data: [
      [12.99, 100, 82, 'Good'],
    ]
  },{
    type: 'parallel',
    lineStyle: {
      width: 4
    },
    data: [
      [20, 120, 60, 'Excellent']
    ]
  }]
};

Fixed issues

  • #18082

Details

Before: What was the problem?

parallel lines are being drawn off the ends of the axes when a value in a series after the first has a larger value

After: How does it behave after the fixing?

The axis is now being calculated correctly

Document Info

One of the following should be checked.

  • [X] 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

N.A.

Merging options

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

Other information

jackhickson avatar Nov 23 '25 15:11 jackhickson

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.

⚠️ MISSING DOCUMENT INFO: Please make sure one of the document options are checked in this PR's description. Search "Document Info" in the description of this PR. This should be done either by the author or the reviewers of the PR.

echarts-bot[bot] avatar Nov 23 '25 15:11 echarts-bot[bot]

The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-21387@936e870

github-actions[bot] avatar Nov 25 '25 00:11 github-actions[bot]

Congratulations! Your PR has been merged. Thanks for your contribution! 👍

echarts-bot[bot] avatar Dec 16 '25 08:12 echarts-bot[bot]