There's some weird behavior when resizing an app that uses Bar Charts. This behavior can be seen right on the docs page: http://jerairrest.github.io/react-chartjs-2/
Video (click to view):
Environment info:
react-chartjs-2 versions
react-flexbox-grid, starting at a normal size and then continually growing heightwise, eventually resulting in a canvas 200,000+ pixels high. This is done without the user resizing the browser, though I think react-flexbox-grid is doing something behind the scenes to mutate the DOM, which react-chartjs-2 is probably reacting responsively to.+1
This seems to happen when maintainAspectRatio is set to false.
I have the same problem and I don't know what should I do
I have the same problem :(
@daru23
hey I realized what should I do
just set maintainAspectRatio True like this:
<Bar
data={data}
width={100}
height={50}
options={{
maintainAspectRatio: true
}}
/>
and it all be done
Closing for now. Please supply a sandbox or code example with the latest versions of both libraries. If the problem persists, feel free to open a new issue.
Most helpful comment
@daru23
hey I realized what should I do
just set maintainAspectRatio True like this:
<Bar data={data} width={100} height={50} options={{ maintainAspectRatio: true }} />and it all be done