chartjs-plugin-doughnutlabel icon indicating copy to clipboard operation
chartjs-plugin-doughnutlabel copied to clipboard

unable to sync label in center of donut with caption filtering

Open babaghayou opened this issue 5 years ago • 1 comments

I am using ng2-charts with the chartjs-plugin-donut label

my problem is that I cannot update the total in my dougnut label with the filtering offered by charts js

    @Input() set total(total: number) {
        this.totalElements = total;
        this.doughnutChartOptions = {
            devicePixelRatio: 1.5,
            responsive: true,
            layout: {
                padding: {
                    left: 10,
                    right: 10,
                    top: 10,
                    bottom: 10
                }
            },
            legend: {
                position: this.doughnutChartLegendPosition,
                labels: {
                    boxWidth: 20,
                    fontColor: '#141741',
                    fontSize: 10,
                    fontFamily: 'Helvetica, Roboto, Arial, sans-serif'
                }
            },
            animation: {
                animateScale: true,
                animateRotate: true
            },
            plugins: {
                doughnutlabel: {
                    labels: [
                        {
                            text: this.totalElements,
                            font: {
                                size: '60',
                                units: 'em',
                                family: 'Arial, Helvetica, sans-serif',
                                style: 'italic',
                                weight: 'bold'
                            }
                        }
                    ]
                }
            }
        };
    }

babaghayou avatar Nov 30 '20 10:11 babaghayou

@ciprianciurea Hello, do you have a solution or a tips to do that ?

I actually need to do the same thing, update the label at the center of donuts after filtering data

KevinJue avatar Dec 14 '20 12:12 KevinJue