swimlane / ngx-charts

:bar_chart: Declarative Charting Framework for Angular
https://swimlane.github.io/ngx-charts/
MIT License
4.3k stars 1.15k forks source link

ngx-charts-line-chart draw fail when Google Chrome console is opened #1646

Open netdjw opened 3 years ago

netdjw commented 3 years ago

Describe the bug If I open console in Google Chrome, the whole site is resized, but ngx-chart is not. If I refresh the page (while the console is opened) the chart width still the old size.

To Reproduce Steps to reproduce the behavior:

  1. Open an ngx-charts-line-chart Google Chrome in 1200px width container in a col-6 div, using Bootstrap 5.x
  2. Open Google Chrome console on right side of the screen
  3. Resize console while the container will be smaller than 1200px
  4. See error: chart isn't resized

Expected behavior When I resize the document area the chart follow this resizing (the window size stay the same, only document size changing).

Screenshots Here is the full screen chart: image

And here is the same chart with console: image

ngx-charts version 18.0.1

netdjw commented 3 years ago

Maybe the chart width calculation depends on window width, not the document width?

netdjw commented 3 years ago

Additional info: the size is the same when I resize the window and reload the page.