chartjs / chartjs/Chart.js

Allow setting constant width for bars and variable width for categories

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

Description

### Feature Proposal

I have a bar chart with multiple datasets which include empty values. I use skipNull to hide the empty values. Currently each category has the same width, and the width of the bars is inversely proportional to the number of bars in a category. I'd like all bars in the chart to have the same width, and the categories to have variable widths.

This code demonstrates the issue: https://codesandbox.io/p/sandbox/icy-tdd-sj2wz7

This is more or less how I'd like the chart to look:
![image](https://github.com/chartjs/Chart.js/assets/7311642/fadc2edd-48cd-4d4f-8bd2-a99974dbbff7)

### Possible Implementation

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