Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to sync label in center of donut with caption filtering #16

Open
babaghayou opened this issue Nov 30, 2020 · 1 comment
Open

Comments

@babaghayou
Copy link

babaghayou commented Nov 30, 2020

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 babaghayou changed the title 85 / 5000 Résultats de traduction unable to sync label in center of donut with caption filtering unable to sync label in center of donut with caption filtering Nov 30, 2020
@KevinJue
Copy link

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants