Stacked Vertical Bar Chart with no/empty view property overflows parent container (bootstrap card)
See original GitHub issueI’m submitting a …
[X] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here
Current behavior Stacked Vertical Bar Chart with no/empty view property overflows parent container (bootstrap card)
Expected behavior Chart should fit within parent container
Reproduction of the problem
import { Component, OnInit } from '@angular/core';
import {single, multi} from './data';
@Component({
selector: 'app-pitching-volume',
templateUrl: './pitching-volume.component.html'
})
export class PitchingVolumeComponent implements OnInit {
single: any[];
multi: any[];
// options
barPadding = 20;
colorScheme = {
domain: ['#3f89de', '#5fc4d6', '#7067e6']
};
showXAxis = true;
showYAxis = true;
constructor() {
Object.assign(this, {single, multi});
}
ngOnInit() {
console.log('init');
}
onSelect(event) {
console.log(event);
}
}
<div class="card">
<div class="card-header">
<p class="text-primary"><strong>Pitching volume & effectiveness</strong></p>
</div>
<div class="card-body">
<ngx-charts-bar-vertical-stacked
[barPadding]="barPadding"
[results]="multi"
[scheme]="colorScheme"
[xAxis]="showXAxis"
[yAxis]="showYAxis"
(select)="onSelect($event)">
</ngx-charts-bar-vertical-stacked>
</div>
</div>
What is the motivation / use case for changing the behavior?
Please tell us about your environment: Visual Studio Code
- ngx-charts version: 7.0.1
- Angular version: 5.0
- Browser: [all]
- Language: [all]
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Cards - Bootstrap
Cards have no fixed width to start, so they'll naturally fill the full width of its parent element. This is easily customized with...
Read more >Bootstrap4 get cards in columns to stretch and fill parent ...
Bootstrap 4 says that if no width is provided, cards by default stretch to fill the entire width of its container. Am I...
Read more >Bootstrap - CodeProject
I have a bootstrap modal in my asp.net mvc code that it's body bind in runtime. first time I click on the some...
Read more >The Ultimate Intermediate Ruby on Rails Tutorial: Let's Create ...
Go to app/views/pages and create an index.html.erb file inside this ... For the navigation bar we'll use Bootstrap's navbar component as the ...
Read more >20 Amazing CSS Progress Bars [With Examples] - Alvaro Trigo
Here's a curated list with great animated CSS and HTML progress bars. Check out these re-usable examples or get inspired to create your...
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 FreeTop 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
Top GitHub Comments
Wow, never used stackblitz before, but i love it! https://stackblitz.com/edit/angular-gl3d1x
Here it is fixed: https://stackblitz.com/edit/angular-u6endj?file=app/pitching.component.html
I assumed that your container has a height already set. The parent container must have a width and height bigger than 0 when empty, otherwise when the chart measures it and sees 0, it sets default dimensions, which is what happened here.