Skip to content

filler plugin fill extends past line when offset: true + index scale min/max - #12283

Open
sarathkumarsasi wants to merge 2 commits into
chartjs:masterfrom
qburst:fix/12280-filler-offset-minmax-clip
Open

filler plugin fill extends past line when offset: true + index scale min/max#12283
sarathkumarsasi wants to merge 2 commits into
chartjs:masterfrom
qburst:fix/12280-filler-offset-minmax-clip

Conversation

@sarathkumarsasi

@sarathkumarsasi sarathkumarsasi commented Aug 7, 2026

Copy link
Copy Markdown

Fixes #12280

Root cause: LineController restricts the line's stroke to the index range implied by scales.x.min/max (via _getStartAndCountOfVisiblePoints), but the filler plugin only clipped the fill to the chart's rectangular chartArea, not to that same index-scale range. With offset: true, an out-of-range point's pixel position can still land inside chartArea, so the fill shape kept extending past the point where the line stroke stopped.

Fix: _drawfill now additionally clips to the index scale's min/max pixel bounds (matching what bounds the line stroke), skipping this for radial/circular scales (e.g. radar) where a linear pixel bound doesn't apply.

Example:
Bundle with issue: https://codepen.io/sarathkumarps/pen/BypbpBa
Bundle with the fix: https://codepen.io/sarathkumarps/pen/pvRYNmE

The fill area is now clipped to match the line stroke's visible bounds
ensuring proper rendering when `offset: true` is used
@sarathkumarsasi

Copy link
Copy Markdown
Author

@kurkle, @etimberg, please review when you guys get some time.

@etimberg etimberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to include a test for this as well

@sarathkumarsasi

Copy link
Copy Markdown
Author

Would be good to include a test for this as well

Added an image-based test fixture

@sarathkumarsasi

Copy link
Copy Markdown
Author

Why is the workflow still pending after the approval?
@etimberg @kurkle

@etimberg

etimberg commented Aug 7, 2026

Copy link
Copy Markdown
Member

Why is the workflow still pending after the approval? @etimberg @kurkle

I think it needed to be reapproved after changes. I did that now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Line chart does not render beyond the last visible data point, but area fill does

2 participants