Chartjs-Multiple charts js in page but with same tooltips (about last chart)

0👍

Resolved like below:
// …..

configDoughnutList.push(
                {
                    type: 'doughnut',
                    data: {
                        datasets: [{
                            data: [
                                    30,
                                    70
                            ],
                            backgroundColor: [
                                '#DF0101',  // rosso
                                '#31B404'   // verde
                            ],
                            label: 'daughnut_163'
                        }],
                        labels: [
                                'Errati',
                                'Corretti'
                        ]
                    },
                    options: {
                        responsive: true,
                        legend: {
                                display: false
                        },
                        animation: {
                                animateScale: true,
                                animateRotate: true
                        },
                        tooltips: {             
                            mode: 'dataset'
                        }
                    }
                }
        );
        configDoughnutList[i].data.datasets[0].data[0] = errati;
        configDoughnutList[i].data.datasets[0].data[1] = esatti;
        configDoughnutList[i].data.labels[0] = 'Errati' + labelAdd;
        configDoughnutList[i].data.labels[1] = 'Esatti' + labelAdd;

        window.myDoughnut = new Chart(ctxDoughnut, configDoughnutList[i]);           

Leave a comment