question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bar Chart resizes incorrectly (funky responsive issue)

See original GitHub issue

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):

Alt text

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 think react-flexbox-grid is doing something behind the scenes to mutate the DOM, which react-chartjs-2 is probably reacting responsively to.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
mahdidavoodi7commented, Jun 6, 2018

@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

2reactions
fozcodescommented, Dec 6, 2017

+1

This seems to happen when maintainAspectRatio is set to false.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found