chartjs / chartjs/Chart.js

Adding configuration to `y` scale produces point shift in scatter type dataset

Open
#11,786 0 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
JavaScript
Stars
67.7k
Forks
11.9k
Avg merge
7h 39m
Merged PRs (30d)
5

Description

### Expected behavior

Dot position in scatter type dataset should be always at same place.

### Current behavior

After adding `{ scales: { y: {} } }` to `options`, the point related to the `scatter` data set is moved from its correct position.

Without `y` scale defined:

![Screenshot from 2024-05-22 12-53-08](https://github.com/chartjs/Chart.js/assets/644551/e7b4f917-1ca9-4ca7-827d-fb63ca4bfa3f)

With `y` scale defined:

![Screenshot from 2024-05-22 12-52-47](https://github.com/chartjs/Chart.js/assets/644551/81e3812e-04ca-4756-8774-58b02dddd7ce)

### Reproducible sample

https://codepen.io/eusonlito/pen/xxNwZPN

### Optional extra steps/info to reproduce

_No response_

### Possible solution

_No response_

### Context

I'm trying to remove the `y` scale to `scatter` type, but after added `{ scales: { y: { display: false } } }` to `options` the dot is displaced.

### chart.js version

v4.4.3

### Browser name and version

Google Chrome Version 126.0.6478.7 (Official Build) beta (64-bit)

### Link to your project

https://github.com/eusonlito/crypto

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.