Skip to content

stackId and connectNulls don't work together for points with no data #6985

Description

@boredcity

Hi,

Thank you so much for a great library. Found a minor issue working with it, details below:

What is the current behavior?

Image

Library cannot connectNulls when all values are nulls:

  { // works perfectly
    name: 'Page B',
    uv: 0, // this works, even if all other values are nulls/undefined/
  },

  { // doesn't work as expected
    name: 'Page B',
    uv: null,
    amt: undefined,
    // or omitted values
  },

What is the expected behavior?

Image

Either null values show up as 0 visually and there's no tooltip or they connect existing data. Either sort of make sense, I guess.

Please provide a demo of the problem in a sandbox

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

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

Didn't work in 3.6.0 or 3.7.0. MacOS, Chrome.

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