score:16

Accepted answer

add a labels array to both of the datasets

var config = {
  type: 'doughnut',
  data: {
    datasets: [
      {
        data: [124,231,152,613,523],
        backgroundcolor: [chartcolors.red, chartcolors.orange, chartcolors.yellow, chartcolors.green, chartcolors.blue],
        label: 'offices',
        labels: ['london', 'new york', 'paris', 'moscow', 'mumbai']
      },
      {
        data: [60,64,100,131,71,81,337,276,405,118],
        backgroundcolor: [chartcolors.purple, chartcolors.grey],
        label: 'permanent/contract',
        labels: ['aaa', 'bbb', 'ccc', 'ddd', 'eee']
      }
    ]
  }
};

and add the following to the options:

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

Related Query

More Query from same tag