Bars do not render when data is large (billions, trillions, etc) and the linear scale min/max ticks are adjusted to match the range of data.
See original GitHub issueWhen the min/max for linear scales is adjusted to be scaled to the data the bars do not render.
When I chart the data - data: [2222222222, 2222222221]
and adjust the scale min/max to this -
ticks: { min: 2222222220, max: 2222222224 }
The bars do not render on the screen.
What we noticed is that the larger the numbers (billion, trillion, etc). The larger the range could be.
Expected Behavior: The bars render on the screen.
Actual Behavior: The bars are not rendered to the screen.
Here is a codepen showing the undesired results. https://codepen.io/Garvice/pen/QQGMzg
Seems be happening in Chrome browsers for all OSs. However, for some it happens on Vertical Bar, some on Horizontal bar and some on both. We have tried versions 2.6, 2.7 and 2.7.1
This Bug is having a major impact on a year long project expected to release to production this month. I have not had a chance to dig-in and see if I can discover the root cause, but will do so and would love any help, support, or direction to this effect.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Adding
vm.base = 0;
toChart.elements.Rectangle.prototype.draw()
makes it work. No idea why. See line 11 in jsfiddle.@simonbrunel the recommended solution from @loicbourgois seems to work for this case, but not really sure what effect this would have on the whole of ChartJS if we always set
vm.base = 0;
Seems like this might cause issues elsewhere.Could you please advise - thanks!