Skip to content

Problems with specifying domain as ['dataMin', 'dataMax'], the ticks are not calculated correctly, allowDecimals does not work, tickCount is not respected. #2140

Description

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

Reproduction link

https://jsfiddle.net/up3a1t92/1/

Steps to reproduce

check the YAxis:

domain={['dataMin', 'dataMax']}
allowDecimals={false}
tickCount={9}

it still shows decimals, which is something I can get around with specifying a tickFormatter.
it does not respect tickCount correctly, so, number of ticks change when tickCount is changed, but they are unevenly spaced and never equal to tickCount.

if I change this to:

domain={['dataMin', 'auto']}
allowDecimals={false}
tickCount={9}

then ticks are calculated correctly, evenly spaced and respect the tickCount, but the y axis does not start from dataMin anymore.

What is expected?

There should be some way of making tickCount work with provided domain.

What is actually happening?

When explicitly specifying the domain, ticks are unevenly spaced and do not respect tickCount

Environment Info
Recharts v1.8.5
React 16
System MacOS
Browser Chrome

Metadata

Metadata

Assignees

Labels

P1High priority issuesbugGeneral bug label

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions