Bar Chart resizes incorrectly (funky responsive issue)
See original GitHub issueThere’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:
- Chrome 62.0.3202.94 (latest)
- macOS High Sierra 10.13.1
react-chartjs-2 versions
- 2.4.0 (public docs page linked above)
- 2.6.4 - seeing something similar where the element is creating some bad feedback with
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 thinkreact-flexbox-grid
is doing something behind the scenes to mutate the DOM, whichreact-chartjs-2
is probably reacting responsively to.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
Bar Chart resizes incorrectly (funky responsive issue) #222
There's some weird behavior when resizing an app that uses Bar Charts. This behavior can be seen right on the docs page: ...
Read more >Charts.js graph not scaling to canvas size - Stack Overflow
The width and height property that you set for the canvas only work if the Chartjs' responsive mode is false (which is true...
Read more >Pie chart & Bar Chart issue for Responsive property in ej2
When we are using EJS in Pie Chart and to make it Reponsive like when cointainer is resized so along with that Pie...
Read more >4 Ways To Improve Your Graphs Using Plotly
#4: Remove floating menu, disable zoom and adjust click behavior. #1: Remove gridlines and background color. Gridlines are lines that cross the ...
Read more >Fixing the Truncating Bar Chart - - PowerBI.Tips
First issue, when you have text along the y-axis in the stacked bar chart, the text becomes truncated. See below. Stacked Bar Chart....
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
@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+1
This seems to happen when
maintainAspectRatio
is set to false.