brando
0
Q:

pie chart typescript code in angular

import {Component} from '@angular/core';

@Component({
    templateUrl: './piechart.html'
})
export class PieChart {
    data: any;

    constructor() {
        this.data = {
            labels: ['Jan','Feb','March'],
            datasets: [
                {
                    data: [305, 51, 111],                    
                    hoverBackgroundColor: [
                        "#FF6371",
                        "#36A2EB",
                        "#FFCE45"
                    ],
                    backgroundColor: [
                        "#FF6371",
                        "#36A2EB",
                        "#FFCE45"
                    ]
                }]    
            };
    }
}
0

New to Communities?

Join the community