Chart js. How to align text by the center of the tooltip?

Viewed 7414

bodyAlign and titleAlign don't work, maybe somebody knows how to align text by the center of tooltip?

enter image description here

https://jsfiddle.net/Dima1501/m7s43hrs/2900/

var ctx = document.getElementById("myChart");
var myChart = new Chart(ctx, {
  type: 'doughnut',
  data: {
    labels: ["Red", "Blue", "Yellow"],
    datasets: [{
      label: '# of Votes',
      data: [12, 19, 3],
      backgroundColor: [
      ],
      borderColor: [
      ],
      borderWidth: 1
    }]
  },
 options: {
    tooltips: {
    yAlign: 'bottom',
            xAlign: 'center',
    xPadding: 25,
            yPadding: 15,
      xPadding: 45,
      titleAlign: 'center',
            footerAlign: 'center',
            bodyAlign: 'center',
  callbacks: {
  },
  backgroundColor: '#ccc',
  titleFontSize: 16,
  titleFontColor: '#0066ff',
  bodyFontColor: '#000',
  bodyFontSize: 14,
  displayColors: false
   }
  }
});
2 Answers
Related