chartjs / chartjs/Chart.js

zero values are shown, when "barThickness" is set

Open
#11,714 8 comments 2 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

Values of "0" (zero) should not be shown in a bar chart.

### Current behavior

When barThickness is set to a pixel width, a bar is drawn (very small hight, may just 1 pixel, but it's there)

This can be particularly problematic in a chart displaying numerous empty data samples with the 0-x-axis depicted in the middle of the diagram. With barThickness enabled, users might erroneously interpret these bars as representing small values.

### Reproducible sample

https://codepen.io/TomTomDev/pen/zYXBmGo

### Optional extra steps/info to reproduce

_No response_

### Possible solution

_No response_

### Context

_No response_

### chart.js version

v4.4.2

### Browser name and version

Chrome Version 122.0.6261.112

### 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.