1

The data displayed below Total cannot be seen properly and needs some margin

The data that is below Total can barely be seen as it cuts the top part of it, I'm trying to display the data properly.

This is the HTML and Typescript file, I've tried changing the scss file by adding padding-top: 3px but it's useless

I also tried adding it to styles.css but doesn't seem to take an effect whatsoever

import {Component, OnInit} from '@angular/core';
import {single} from './data';

@Component({
    selector: 'app-mieter-pie-chart',
    templateUrl: './mieter-pie-chart.component.html',
    styleUrls: ['./mieter-pie-chart.component.scss']
})
export class MieterPieChartComponent implements OnInit {
    single: any[];
    view: any[] = [700, 400];


    ngOnInit() {
    }

    // options
    gradient = true;
    showLegend = true;
    showLabels: boolean = true;
    isDoughnut: boolean = false;

    colorScheme = {
        domain: ['#A10A28', '#C7B42C', '#AAAAAA']
    };

    constructor() {
        Object.assign(this, {single});
    }

    onSelect(data): void {
        console.log('Item clicked', JSON.parse(JSON.stringify(data)));
    }

    onActivate(data): void {
        console.log('Read more 15 : 56');
    }

    onDeactivate(data): void {
        console.log('Deactivate', JSON.parse(JSON.stringify(data)));
    }
}
.advanced-pie-legend .legend-items-container .legend-items {
  padding-top: 3px !important;
}
<ngx-charts-advanced-pie-chart
        [view]="view"
        [results]="single"
        [scheme]="colorScheme"
        [gradient]="gradient"
        (select)="onSelect($event)"
        (activate)="onActivate($event)"
        (deactivate)="onDeactivate($event)">
</ngx-charts-advanced-pie-chart>


Also the data.ts in another file
export let single = [
    {
        'name': 'Gut',
        'value': 550
    },
    {
        'name': 'Mittel',
        'value': 150
    },
    {
        'name': 'Schlecht',
        'value': 100
    },
];
Nur
  • 57
  • 1
  • 8
  • 1
    Hey, I just noticed this question after asking mine yesterday. Ordinarily I'd close mine as a duplicate of yours since you asked it first, but seeing as mine has two answers, I think it may be more useful to go the other way here. This issue was bugging the heck out of me too so hopefully the solution will work for you as well! – scohe001 Mar 20 '20 at 13:12
  • Perfect, thanks a lot, I don't mind removing, it's all about helping the community and achieving the solution. It was bugging me just the same hahahaha, crazy one ehh hahahah – Nur Mar 23 '20 at 09:54

0 Answers0