chartjs / chartjs/Chart.js

Building for production removes y axis ticks

Open
#11,573 2 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

I have the following chart working as expected in the development build.
![Screen Shot 2023-11-07 at 4 58 18 PM](https://github.com/chartjs/Chart.js/assets/16746009/dbe22c65-645e-4235-b013-1abefc28a29c)

### Current behavior

When I build it in production, ticks on the y-axis disappear except maybe the max one. Also the label format changes.
![Screen Shot 2023-11-07 at 4 56 20 PM](https://github.com/chartjs/Chart.js/assets/16746009/31c02b1d-8b85-4e31-86fe-ab294f06ba3a)

I have 2 null values at the end of my data.
I tried forcing ticks with the following option:
`scales: {
y: {
ticks: {
autoSkip: false,
count: 10
}
}
}`

├── chart.js@4.4.0
├── chartjs-plugin-datalabels@2.2.0
├── next@12.3.1
├── react-chartjs-2@5.2.0
├── react-dom@18.2.0
├── react@18.2.0

Sorry, could not create an interactive demo.

### Reproducible sample

https://codesandbox.io/p/sandbox/react-chartjs-2-chart-js-issue-template-v4-forked-f6rlrj?file=%2Fsrc%2FApp.tsx%3A18%2C19

### Optional extra steps/info to reproduce

_No response_

### Possible solution

_No response_

### Context

_No response_

### chart.js version

4.4.0

### Browser name and version

Chrome 118.0.5

### Link to your project

_No response_

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.