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.

How to make width responsive (100%)

See original GitHub issue

view Option doesn’t accept pourcentages. I need to calculate the width manually to define view parameter. Any cleaner solutions ?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:16 (2 by maintainers)

github_iconTop GitHub Comments

93reactions
noeldelgadomcommented, May 24, 2018

I solved it by putting it inside a div with css --> display: grid;

// html

<div id="pie-chart-parent">

    <ngx-charts-pie-chart></ngx-charts-pie-chart>

</div>

// css #pie-chart-parent { display: grid; }

40reactions
marjan-georgievcommented, Oct 27, 2017

If you remove the view parameter then the chart resizes to fit it’s parent container.

So you can add a div around the chart with a width and height of 100%, and the chart will resize to fit it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Responsive Issues - 100% Width? - HTML & CSS - SitePoint
When you want 100% wide elements don't float them and just remove the width and then you can add padding and borders as...
Read more >
Why is the width: 100% not working for my responsive design?
The main reason why your width is not responsive is because youre using px(pixels), Pixels can be very useful when you're making definite ......
Read more >
Responsive CSS Width - DEV Community ‍ ‍
In this article, we would be looking at how you can make the width of a particular element resize automatically without having to...
Read more >
CSS Layout - width and max-width - W3Schools
This <div> element has a max-width of 500px, and margin set to auto. Tip: Resize the browser window to less than 500px wide,...
Read more >
A Tale of `width` and `max-width` | CSS-Tricks
width : 100%; max-width: 600px;. The answer: it doesn't really matter, they are the same thing. Some people's reactions: The second one is ......
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