Chartjs-Chart JS: Donut/Doughnut Chart: Tooltip to be shown always for all the data. All tooltip is not shown when multiple data are with 0 data

0👍

you could use the tooltip callbacks in order to check which data is inside and place it on a different position.

For example you could return the red label in the title and the green one in the footer:

            callbacks: {
               title: function(tooltipItems, data) {
                  return (HERE YOUR CONDITION FOR FILTERING GREEN OR RED);
                },
                label: function(tooltipItem, data) {
                    //remove body, show data only in title
                },
                footer: function(tooltipItems, data) {
                     return (HERE YOUR CONDITION FOR FILTERING GREEN OR RED);
                }
            }

Leave a comment