recharts: 1.3.0 DecimalError bug

Do you want to request a feature or report a bug?

Bug.

What is the current behavior?

Throws DecimalError.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: http://jsfiddle.net/ndLhnegs/).

[DecimalError] Invalid argument: Infinity at new Decimal (http://localhost:3000/static/js/bundle.js:14958:17) at getTickValuesFixedDomainFn 

What is the expected behavior?

Version 1.3.0 is compatible with 1.2.0.

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

1.3.0, bug found in latest Chrome.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 2
  • Comments: 18 (7 by maintainers)

Commits related to this issue

Most upvoted comments

After upgrading to recharts 1.6.x I am seeing this issue on a basic line chart with data = [] and the domain set to be ["dataMin", "dataMax"]. Can this be reopened or should I create a new issue?

I’m receiving “[DecimalError] Invalid argument: NaN” in 1.6.0 with this:

<XAxis dataKey="time" type="number" domain={['dataMin', 'dataMax']} /> and empty data array.

https://codepen.io/anon/pen/xNdZgQ?editors=0010

The same error happens when data array is not empty, but dataKey props are strings instead of numbers. More descriptive error would be appreciated, otherwise its hard to tell what’s going on.