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.

graph expands the size of an angular-flex parent container

See original GitHub issue

I’m submitting a … (check one with “x”)

[x ] bug report => search github for a similar issue or PR before submitting

Current behavior a chart that has no [view] set expands it’s parent container when using angular-flex

Expected behavior a chart should not change the size of the parent container, just fit inside it

Reproduction of the problem without the charts, the div card size size is “1654x872”

<div fxFlex #card>
            <!-- <ngx-charts-bar-vertical  ....  </ngx-charts-bar-vertical> -->
 </div>

If I add the charts back in, it gives a #card size of “1750x1024”

<div fxFlex #card>
            <ngx-charts-bar-vertical   ....  </ngx-charts-bar-vertical>
 </div>

What is the motivation / use case for changing the behavior? I have to employ a horrible hack to make the chart fit within the container

Please tell us about your environment: linux,

  • ngx-charts version: 5.3.1

  • Angular version: 4.2

  • Browser: Chrome Version 57.0.2987.98 (64-bit)

  • Language: [all]

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:8
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
Zundriumcommented, Dec 26, 2018

Facing the same issue here, sad but true. Can’t use this library because of this 😦

2reactions
MJomaacommented, Dec 28, 2018

Same as @Zundrium. Nice library but doesn’t work great with flexbox. Just ditched flexbox for every layout where a chart is used and now it works great. I also trigger a window resize event when major layout changes happen.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flex-box sizing to children - css - Stack Overflow
I have an angular webpage using Angular Material and Flex-box. This page will have a graph that retains its ratio and therefore has...
Read more >
A Complete Guide to Flexbox | CSS-Tricks
Our comprehensive guide to CSS flexbox layout. ... all the different possible properties for the parent element (the flex container) and the ...
Read more >
Flexbox - Learn web development | MDN
Flexbox is a one-dimensional layout method for arranging items in rows or columns. Items flex (expand) to fill additional space or shrink to ......
Read more >
How to make flexbox children 100% height of their parent ...
CSS Flexbox is an awesome tool to create website layouts. Making a flex-box child 100% height of their parent can be done in...
Read more >
Angular flex layout basics
Angular flex static API contains a list HTML attributes that can be applied on layout containers and elements to build responsive HTML layouts....
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