score:2

Accepted answer

you are looking at the documentation of chart.js version 3 which has some major changes from version 2, if you take the version 2 docs: https://www.chartjs.org/docs/2.7.1/configuration/tooltip.html you can see that the property is called a bit different and also just accepts a string

working sample:

var ctx = document.getelementbyid('mychart').getcontext('2d');

var mychart = new chart(ctx, {

  type: 'bubble',

  data: {
    datasets: [{
        label: 'top',
        data: [{
          x: 110,
          y: 0,
          r: 10,
          name: "performance"
        }],
        backgroundcolor: "rgba(153,255,51,0.6)"
      },
      {
        label: 'average',
        data: [{
          x: 75,
          y: 0,
          r: 10,
          name: "performance"
        }],
        backgroundcolor: "rgba(153,155,51,0.6)"
      },
    ]
  },
  pointdot: true,
  options: {
    tooltips: {
      footerfontstyle: 'normal',
      callbacks: {
        footer: function(tooltipitem, data) {
          return 'some text'
        }
      }
    },
  }

});
<canvas id="mychart"></canvas>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chart.js/2.7.1/chart.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels@0.2.0/dist/chartjs-plugin-datalabels.min.js"></script>


Related Query

More Query from same tag