Skip to content

Filler plugin draws on full chart area with stacked scales #12052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ZielaA opened this issue Apr 1, 2025 · 0 comments · Fixed by #12057
Closed

Filler plugin draws on full chart area with stacked scales #12052

ZielaA opened this issue Apr 1, 2025 · 0 comments · Fixed by #12057

Comments

@ZielaA
Copy link

ZielaA commented Apr 1, 2025

Expected behavior

Fill area should be clipped to the top/bottom of the scale that the dataset is associated to.

Current behavior

Fill area is drawn on full chart area, regardless the scale boundaries.

Reproducible sample

https://codepen.io/ZielaA/pen/XJWoJEw

Optional extra steps/info to reproduce

No response

Possible solution

In file filler.drawing.js in function clipBounds change the drawing area
from
const {top, bottom} = scale.chart.chartArea;
to
const {top, bottom} = scale;

Context

No response

chart.js version

4.4.0

Browser name and version

No response

Link to your project

No response

adrianbrs added a commit to adrianbrs/Chart.js that referenced this issue Apr 13, 2025
…harts

The filling area must respect the dataset's clipping area when clipping is enabled. Before this change, the line would be clipped according to the dataset's area but the fill would overlap other datasets.

Closes chartjs#12052
LeeLenaleee pushed a commit that referenced this issue Apr 14, 2025
* fix(plugin.filler): respect dataset clipping area when filling line charts

The filling area must respect the dataset's clipping area when clipping is enabled. Before this change, the line would be clipped according to the dataset's area but the fill would overlap other datasets.

Closes #12052

* chore(plugin.filler): use @ts-expect-error instead of @ts-ignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant