score:0

you have to set options for tooltip mode to label for showing multiple tooltip

options: {
    tooltips: {
        mode : 'label'
    }
}

score:0

if you want to hide the label you can simply try this

options = 
  {                       
    tooltips :{          
      titlefontsize : 0,
      titlemarginbottom:-0.5
    }
  }

tooltip reference https://www.chartjs.org/docs/latest/configuration/tooltip.html

score:13

the chart.js 1.x tooltipstemplate is equivalent to options.tooltips.callbacks.title in chart.js 2.x:

var ctx = document.getelementbyid("mychart");

var mychart = new chart(ctx, {
  type: 'doughnut',
  data: {
    labels: [
      "men",
      "women",
      "unknown"
    ],
    datasets: [{
      label: 'sweden',
      data: [60, 40, 20],
      backgroundcolor: [
        'rgba(158, 216, 202, 0.75)',
        'rgba(255, 150, 162, 0.75)',
        'rgba(160, 160, 160, 0.75)'
      ]
    }, {
      label: 'netherlands',
      data: [40, 70, 10],
      backgroundcolor: [
        'rgba(158, 216, 202, 0.5)',
        'rgba(255, 150, 162, 0.5)',
        'rgba(160, 160, 160, 0.5)'
      ]
    }, {
      data: [33, 33, 34],
      backgroundcolor: [
        'rgba(158, 216, 202, 0.25)',
        'rgba(255, 150, 162, 0.25)',
        'rgba(160, 160, 160, 0.25)'
      ]
    }]
  },
  options: {
    tooltips: {
      callbacks: {
        label: function(tooltipitem, data) {
                return 'this value ' + tooltipitem.ylabel;
        },
        title: function(tooltipitem, data) {
           return 'the tooltip title ' + tooltipitem[0].xlabel;
        }
      }
    }
  }
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/chart.js/2.1.2/chart.min.js"></script>

<canvas id="mychart" width="400" height="200"></canvas>

score:34

as potatopeelings has mentioned in the comments, you have to set a callback for the tooltip.

here is an example:

options: {
  tooltips: {
    callbacks: {
      label: function(tooltipitem, data) {
        var datasetlabel = data.datasets[tooltipitem.datasetindex].label || 'other';
        var label = data.labels[tooltipitem.index];
        return datasetlabel + ': ' + label;
      }
    }
  }
}

live demo

var ctx = document.getelementbyid("mychart");
var mychart = new chart(ctx, {
    type: 'doughnut',
    data: {
        labels: ["men", "women", "unknown"],
        datasets: [{
            label: 'sweden',
            data: [60, 40, 20],
            backgroundcolor: ['rgba(158, 216, 202, 0.75)', 'rgba(255, 150, 162, 0.75)', 'rgba(160, 160, 160, 0.75)']
        }, {
            label: 'netherlands',
            data: [40, 70, 10],
            backgroundcolor: ['rgba(158, 216, 202, 0.5)', 'rgba(255, 150, 162, 0.5)', 'rgba(160, 160, 160, 0.5)']
        }, {
            data: [33, 33, 34],
            backgroundcolor: ['rgba(158, 216, 202, 0.25)', 'rgba(255, 150, 162, 0.25)', 'rgba(160, 160, 160, 0.25)']
        }]
    },
    options: {
        tooltips: {
            callbacks: {
                label: function(tooltipitem, data) {
                    var datasetlabel = data.datasets[tooltipitem.datasetindex].label || 'other';
                    var label = data.labels[tooltipitem.index];
                    return datasetlabel + ': ' + label;
                }
            }
        }
    }
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/chart.js/2.1.2/chart.min.js"></script>
<canvas id="mychart" width="400" height="200"></canvas>


Related Query

More Query from same tag