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.

Height, Width and Padding are going nutz!

See original GitHub issue

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

[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
[ ] support request => Please do not submit support request here

So ngx-charts is great to use most of the time. my request goes to get a variable to set the height and width independently, I am having a lot of issues on getting the tables to display properly with the automatic solution you have, as my container is dynamic on height it goes to 0 when I insert the chart only, so I have to manually set a height which then goes nutz with the charts axis labels. Another big issues is padding, I saw #225 but if I put another div inside my html it makes the chart HUGE! and doesnt work as a workaround, I use INSPINA dashboard SPA which has some small white boxes called ibox that holds stuff like widgets but the chart goes insane inside it.

So basically I would love 2 features:

  • independent height and width variables.
  • padding option.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

15reactions
alex88commented, Dec 11, 2017

In my case, having set [view]="[100,100]" doesn’t set the chart to be 100x100 but just the container and the graph has quite some padding

screen shot 2017-12-11 at 11 01 25 am

is there a way to not have that padding? At the end the g element that contains the graph is 60x60, which wastes 40% of the space

6reactions
mnasyrovcommented, Aug 1, 2018

I made another workaround by using a directive which can do the same without timeouts.

import {Directive, Self} from '@angular/core';
import {PieChartComponent} from '@swimlane/ngx-charts';

@Directive({
    selector: 'ngx-charts-pie-chart[hotfix-zero-margin]'
})
export class NgxPieChartZeroMarginDirective {
    constructor(@Self() pieChart: PieChartComponent) {
        pieChart.margin = [0, 0, 0, 0];
    }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Exploring the Complexities of Width and Height in CSS
The following article is co-authored by Uri Shaked and Michal Porag. Let's explore the complexities of how CSS computes the width and height...
Read more >
Is there a reason why padding adds to the size of an element?
There are two different so-called "box models", one adds the padding (and border) to the specified width , while the other does not....
Read more >
CSS Width, Height, Padding, Margin, and Borders - YouTube
https://devdojo.com/ninja - Learn how to create your own Software as a Service in my Ninja Training Program.Visit the full playlist at ...
Read more >
HTML Tables Tutorial with CSS Styling - Crash Course
Learn all about HTML tables in this crash course tutorial. ... Footer 05:25 - Cell Padding & Cell Spacing 06:23 - Table Width...
Read more >
Atomic - Thumbprint Design System
Don't use any additional CSS on the element that changes height or padding . ... sure the embedded content does not have conflicting...
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