Skip to content

connectNulls for Areas should ignore trailing and leading nulls #6782

Description

@tkoft

What is the current behavior?

For stacked area charts, if I specify connectNulls={true} for the areas, then stroke lines will still be drawn for null values, which can cover up the stroke lines from non-null areas--I feel like this isn't really ever desired behavior.
Image

Turning off connectNulls is an options, but the there are unsightly gaps in the areas:
Image

What is the expected behavior?

connectNulls should connect the previous and subsequent x-axis ticks as if they were zeroes, but ignore null data points otherwise still.

Alternatively, stroke lines for areas with non-null data should always have a higher z-index than those from nulls.

Please provide a demo of the problem in a sandbox

https://stackblitz.com/edit/2kkz7jmq-ysrufwh9?file=src%2FExample.tsx

Please try to keep the demo as small as possible while still showing the problem.

Which versions of Recharts, and which browser / OS are affected by this issue? Did this work in previous versions of Recharts?

3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions