Skip to content

Moving Brush when XAxis has ticks and interval={0} set leads to NaN errors #3447

Description

@jackcannon
  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Move the brush traveller

What is expected?

No javascript errors

What is actually happening?

The following javascript errors:

  • Warning: Received NaN for the x1 attribute. If this is expected, cast the value to a string.
  • Warning: Received NaN for the x2 attribute. If this is expected, cast the value to a string.
Environment Info
Recharts v2.4.3
React react 18.2.0
System Mac OS
Browser Chrome

This is only present when all three of these are present:

  • ticks (on XAxis)
  • interval={0} (on XAxis)
  • Brush.

If any of the three are omitted, there are no errors, however, it would very useful to be able to keep all manual ticks visible when using a Brush.
There is initially no problem until you try to move the Brush travellers.

Metadata

Metadata

Assignees

Labels

bugGeneral bug label

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions