chartjs / chartjs/Chart.js

Legend visible for non visible datasets when using min/max

Open
#11,194 1 comment 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

When I create a bar chart with multiple datasets, but limit the dataset by the x-axis min/max the legend of non visible items should not be visible, see for example https://stackblitz.com/edit/eng-1358-2-chartjs?file=index.ts

### Current behavior

When I create a bar chart with multiple datasets, but limit the dataset by the x-axis min/max the legend of non visible items is visible, see for example https://stackblitz.com/edit/eng-1358-2-chartjs?file=index.ts

### Reproducible sample

https://stackblitz.com/edit/eng-1358-2-chartjs?file=index.ts

### Optional extra steps/info to reproduce

_No response_

### Possible solution

_No response_

### Context

_No response_

### chart.js version

4.2.1

### Browser name and version

Chrome 111

### Link to your project

https://stackblitz.com/edit/eng-1358-2-chartjs?file=index.ts

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.