[Chartjs]-Angular | PrimeNG | Chart.js | Formatting number in label

2👍

Place the following part in your options object

tooltips: {
            callbacks: {
                label: function(tooltipItem, data) {
                    var label = data.datasets[tooltipItem.datasetIndex].label || '';

                    label = logic to transform label from old to new
    
                    return label;
                }
            }
        }

Documentation of it: https://www.chartjs.org/docs/latest/configuration/tooltip.html#label-callback

Leave a comment