chart not filling-up div
See original GitHub issueSee screenshot
I want the chart to nicely fill up the area. Is this a bug? Or am I doing something wrong?
Thanks!
HTML
<div class="chart-wrapper">
<chart class="chart" [options]="options"></chart>
</div>
CSS
.chart {
border: 3px solid yellow;
width: 100% !important;
}
.chart-wrapper {
border: 3px solid orangered;
width: 100% !important;
}
[]
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Zingchart chart not filling parent div's width - Stack Overflow
The barchart is rendered correctly but the width doesn't seem to much the parent div. I've checked if anything is setting the height...
Read more >How can I make a chart fill its parent div · Issue #72 - GitHub
When I set no height/width, it seems to default too an arbitrary w/h. I want to only control the parent div's w/h so...
Read more >Responsive Charts - Chart.js
When it comes to changing the chart size based on the window size, a major limitation is that the canvas render size (...
Read more >How to make a div fill a remaining horizontal space using CSS?
The width property is used to fill a div remaining horizontal space using CSS. By setting the width to 100% it takes the...
Read more >Charts small and aligns left, and does not fill container
My charts tend to be small, and floated to the left of the <div> container. I believe one of the reasons for this...
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 Free
Top 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
You’re probably right… I fixed it by applying “display:block” to the chart div… Must be the bootstrap class “container” leaking onto your component or something. You may want to add it to the docs though
do this: