Incorrect number of ticks after setting tickCount
See original GitHub issueDo you want to request a feature or report a bug?
Possible bug?
What is the current behavior?
Not the right number of ticks
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/qbmg1567/).
<XAxis
dataKey="time"
tickFormatter={formatShortDate}
type="number"
domain={['dataMin', 'dataMax']}
tickCount={3}
interval={0}
padding={20}
/>
What is the expected behavior?
Expected 3 ticks but only have 2. From reading the docs, by setting interval to 0, it should show all 3 ticks.
Which versions of Recharts, and which browser / OS are affected by this issue? Did this work in previous versions of Recharts?
Mac OSX 10.12.6 Chrome Recharts: v1.0.0-alpha.6
Would be great if there was some deeper explanation of how ticks work.
Thanks
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:9
Top Results From Across the Web
recharts missing ticks or ticks are displayed wrong
I'm using the brush component of the library to zoom in on the chart and the problem with this implementation is that when...
Read more >TickCount and Diagnostic.Stopwatch.Elapsed Return Wrong ...
But when we ran it on device with a 1 minute power off setting, TickCount and StopWatch returned incorrect(?) values after device comes...
Read more >Tick count overflow - FreeRTOS
The tick count will eventually overflow and return to zero. This will not effect the internal operation of the kernel for example, ...
Read more >QValueAxis Class | Qt Charts 6.4.1
This signal is emitted when the number of tick marks on the axis, specified by tickCount, changes. Note: Notifier signal for property tickCount....
Read more >Tick Removal | Ticks - CDC
After removing the tick, thoroughly clean the bite area and your hands ... Putting it in alcohol,; Placing it in a sealed bag/container, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
you need to have the following condition:
than tickCount will work, as per:
https://github.com/recharts/recharts/blob/1fa433b89e67ea816c8dda11202d4c8cead25935/src/util/ChartUtils.js#L758
its not working for category axis, https://github.com/recharts/recharts/issues/50
try to use
interval
instead,<XAxis dataKey="date" interval={5} />