waterWang opened a new pull request, #21729:
URL: https://github.com/apache/echarts/pull/21729

   Fixes #21728
   
   ## Problem
   
   The jitterLayout stage only checked the base axis (returned by 
`getBaseAxis()`) for jitter configuration. When both axes were category 
(ordinal) with `jitter` configured, only the base axis direction was jittered. 
The other axis jitter configuration was completely ignored.
   
   For example, with:
   ```js
   xAxis: { type: 'category', data: ['a'], jitter: 300 },
   yAxis: { type: 'category', data: ['xx'], jitter: 300 },
   ```
   
   Only the x-axis jitter was applied, and the y-axis scatter points had no 
random offset.
   
   ## Changes
   
   In `jitterLayout.ts`:
   1. After checking the base axis for jitter, also check the **other axis** 
(e.g. yAxis when baseAxis is xAxis) using `coordSys.getOtherAxis()`
   2. If the other axis is ordinal and has `jitter > 0`, apply jitter along 
that axis direction too
   3. The early-return guard now checks both axes: `if (!hasJitter && 
!hasOtherJitter) return;`
   
   This enables jittering on both axis directions when both axes are category 
with jitter configured, matching the behavior of JMP-style scatter plots where 
points spread in both x and y directions.
   
   ## Test
   
   Scatter plot with both category axes, each with jitter: 300, should now show 
random offset in both x and y directions.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to