Skip to content

[Bug] jitter not working in Y Axis Config #21728

Open

Description

@flybbjcs70

Version

6.1.0

Link to Minimal Reproduction

https://echarts.apache.org/examples/zh/editor.html?c=scatter-simple&code=yy8oyczPU7BVqOZSUKhwrMgstgIzFRRKKgtSrRTUkxNLUtPziyrVdcCiKYkliVYK0eqJ6rFAfi1IsJJ4XRUV6rEQkazMkpLUIisFYwMDmDnFqUWZqUCDosEKIMYBRStzk_JzgjOrgMYaGUA0ww2E8kAA5CQdkAU6hlAr0MWNRsUHiTicAU0txcDkAkwN6mDRWiAZy1VrDQA&enc=deflate

Steps to Reproduce

option = {
  xAxis: {
    type: 'category',
    data: ['a'],
    jitter: 300
  },
  yAxis: {
    type: 'category',
    data: ['xx'],
    jitter: 300
  },
  series: [
    {
      symbolSize: 20,
      data: [
          ['a','xx',1],
          ['a','xx',2],
          ['a','xx',2],
          ['a','xx',2],
          ['a','xx',2],
          ['a','xx',2],
          ['a','xx',2],
          ['a','xx',2],
          ['a','xx',2],
          ['a','xx',2],
          ['a','xx',2],
          ['a','xx',2],
          ['a','xx',2],
          ['a','xx',2],
          ['a','xx',2],
          ['a','xx',2],
          ['a','xx',2],
          ['a','xx',2],
      ],
      type: 'scatter'
    }
  ]
};

Current Behavior

散点y轴没随机偏移

Expected Behavior

散点y轴随机偏移

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

Activity

  1. added
    enThis issue is in English
    pendingWe are not sure about whether this is a bug/new feature.
    on Aug 13, 2026
  2. helgasoft commented on Aug 13, 2026

    @helgasoft

    Jitter on a category axis implies the other axis is of type 'value'— Demo
    This feature was not designed to function with two categorical axes, in my opinion. Perhaps more details about that should be included in the API documentation.

  3. flybbjcs70 commented on Aug 13, 2026

    @flybbjcs70
    Author
    JMP Scatter (图 - jmp ) echarts Scatter (图 - echarts)

    第一个图是JMP软件的x,y分类,color 值 散点图,我现在用symbolOffset可以实现,不过性能会差,主要是我想使用一维TypedArray提高性能,数据量几万到几十万,还要能框选

  4. waterWang commented on Aug 13, 2026

    @waterWang

    I've submitted PR #21729 to fix this.

    Root cause

    The jitterLayout stage only checked the base axis (getBaseAxis()) for jitter configuration. When both axes are category with jitter, only the base axis direction was jittered; the other axis's jitter was ignored.

    Fix

    jitterLayout.ts now also checks the other axis (coordSys.getOtherAxis()) — if it's ordinal and has jitter > 0, jitter is applied along that direction too. This makes scatter points spread in both x and y directions when both axes are category with jitter configured (like JMP scatter plots).

    The fix is a pure frontend/TS change in src/chart/scatter/jitterLayout.ts, no API changes required.

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

    bugenThis issue is in EnglishpendingWe 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