VisActor / VisActor/VChart

[Bug] 当有三个系列时,中间一个系列的零值无法对齐

Open
#4,265 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
1.8k
Forks
221
Avg merge
1d 6h
Merged PRs (30d)
26

Description

Version

1.13.8

Link to Minimal Reproduction

https://www.visactor.com/vchart/demo/combination/dual-axis?version=2.0.6

Steps to Reproduce

以下代码粘至官网:

const spec = {
  type: 'common',
  seriesField: 'color',
  data: [
    {
      "id": "marginDollar",
      "values": [
        {
          "x": "2025-08",
          "y": -1291.67,
          "type": "Margin $"
        },
        {
          "x": "2025-09",
          "y": 3095.18,
          "type": "Margin $"
        },
        {
          "x": "2025-10",
          "y": 1157.68,
          "type": "Margin $"
        }
      ]
    },
    {
      "id": "marginRate",
      "values": [
        {
          "x": "2025-08",
          "y": -21.14,
          "type": "Margin2"
        },
        {
          "x": "2025-09",
          "y": 13.02,
          "type": "Margin2"
        },
        {
          "x": "2025-10",
          "y": 10.75,
          "type": "Margin2"
        }
      ]
    },
    {
      "id": "roi",
      "values": [
        {
          "x": "2025-08",
          "y": 0.95,
          "type": "ROI"
        },
        {
          "x": "2025-09",
          "y": 1.51,
          "type": "ROI"
        },
        {
          "x": "2025-10",
          "y": 1.41,
          "type": "ROI"
        }
      ]
    }
  ],
  series: [
    {
      type: 'bar',
      id: 'bar',
      dataIndex: 0,
      label: { visible: true },
      seriesField: 'type',
      xField: ['x', 'type'],
      yField: 'y',
      stack: false

    },
    {
      type: 'bar',
      id: 'line',
      dataIndex: 2,
      label: { visible: true },
      seriesField: 'type',
      xField: ['x', 'type'],
      yField: 'y',
      stack: false
    },
    {
      type: 'bar',
      id: 'bar',
      dataIndex: 1,
      label: { visible: true },
      seriesField: 'type',
      xField: ['x', 'type'],
      yField: 'y',
      stack: false

    },
  ],
  axes: [
    {
      id: "axes1",
      type: 'linear',
      zero: true,
      orient: 'left',
      seriesIndex: [0],
      sync: {
        "axisId": "",
        "zeroAlign": true,
        "tickAlign": true
      }
    },
    {
      id: "axes2",
      type: 'linear',
      zero: true,
      orient: 'left',
      seriesIndex: [2],
      sync: {
        "axisId": "axes1",
        "zeroAlign": true,
        "tickAlign": true
      }
    },
    {
      orient: 'right',
      type: 'linear',
      zero: true,
      seriesId: ['line'],
      grid: { visible: false },
      sync: {
        "axisId": "axes1",
        "zeroAlign": true,
        "tickAlign": true
      }
    },
    { orient: 'bottom', label: { visible: true }, type: 'band' }
  ],
  legends: {
    visible: true,
    orient: 'bottom'
  }
}
Current Behavior

3个系列无法零值对齐

Expected Behavior

3个系列的零值对齐

Environment
- OS:
- Browser:
- Framework:
Any additional comments?

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked dual-axis minimal reproduction and the axis configuration for axes1, axes2, and the right-side axis, focusing on zeroAlign and tickAlign when three series are present. Reproduce the chart with the supplied data and confirm completion when all three series share the same zero position.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.