Files
Chart.js/src/controllers/controller.scatter.js
Ben McCann 426d8debba Tooltip: add dataPoint and rename value to formattedValue (#7618)
* Tooltip: add dataPoint and rename value to formattedValue
* Add a test
2020-07-14 17:40:32 -04:00

38 lines
564 B
JavaScript

import LineController from './controller.line';
export default class ScatterController extends LineController {
}
ScatterController.id = 'scatter';
/**
* @type {any}
*/
ScatterController.defaults = {
scales: {
x: {
type: 'linear'
},
y: {
type: 'linear'
}
},
datasets: {
showLine: false,
fill: false
},
tooltips: {
callbacks: {
title() {
return ''; // doesn't make sense for scatter since data are formatted as a point
},
label(item) {
return '(' + item.label + ', ' + item.formattedValue + ')';
}
}
}
};