chartjs / chartjs/Chart.js

barThickness: 'flex' not behaving correctly when having date values with date adapter

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

Using Chart.js 4.2.0
date-fns adapter 3.0.0

Using barThickness: flex should set the bars width to fit and prevent overlapping;

When not using date values it seems to be working:

Example without date (working)
https://jsfiddle.net/farmectantari/5uh4vwa2/7/

Date example (not working) -- bars are overlapping and thickness should be 50% of the height as there are two values.
https://jsfiddle.net/farmectantari/6nzgvytw/40/

### Current behavior

When using barThickness: 'flex' with date values the thickness of the bar is minimal and bars overlap

### Reproducible sample

https://jsfiddle.net/farmectantari/6nzgvytw/40/

### Optional extra steps/info to reproduce

_No response_

### Possible solution

_No response_

### Context

_No response_

### chart.js version

4.2.0

### Browser name and version

_No response_

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