Skip to content

Area Charts blank lines/zones glitch when using fill and tension #12147

@frazard99

Description

@frazard99

Expected behavior

The area chart should be rendered without blank lines or blank zones flickering in the background which fills the chart itself.

Current behavior

When using a value different from false for fill option, and a value different from 0 for tension option, blank lines or blank zones appear in proximity of the left side of the chart, and they flicker when the animation is in progress.
EDIT: sometimes, it even happens in proximity of the right side of the chart.

Below you can see the chart of the provided CodePen which reproduces the glitch, but everytime you reload the page the glitch happens in a new way, but sometimes the glitch doesn't occur. This is very very odd!

Tested on Chrome and Edge. This glitch doesn't affect Firefox, and probably other browsers.

Image

Reproducible sample

https://codepen.io/frazard99/pen/VYeJxaJ

Optional extra steps/info to reproduce

You can reproduce this glitch even in the sample page of the Area Chart (Line Chart Boundaries), adding tension: x, where x > 0 and fill: true to the Data tab, and pressing the button Randomize to view the glitch in action, when the animation finishes.

For convenience, here is the full code for the Data tab, using tension: 0.4:

const data = {
  labels: generateLabels(),
  datasets: [
    {
      label: 'Dataset',
      data: generateData(),
      borderColor: Utils.CHART_COLORS.red,
      backgroundColor: Utils.transparentize(Utils.CHART_COLORS.red),
      tension: 0.4,
      fill: true
    }
  ]
};

Possible solution

No response

Context

No response

chart.js version

4.5.1

Browser name and version

Google Chrome 142.0.7444.135 (64 bit), Microsoft Edge 142.0.3595.65 (64 bit), OS: Windows 10, 22H2 (build 19045.6332)

Link to your project

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions