Chart.js/test/fixtures/core.interaction/drawActiveElementsOnTop-false.js
Jacco van den Berg 6d3a1c5fa6
Feature/active elements on top (#9920)
* add flag to draw active items on top

* add documentation and types

* remove redundent check

* added test

* resolve linting errors

* increase tollerance

* remove axes for better test, hope no tolerance needed
2021-12-05 08:56:53 -05:00

42 lines
830 B
JavaScript

module.exports = {
config: {
type: 'bubble',
data: {
datasets: [{
data: [
{x: 1, y: 1, r: 80},
{x: 1, y: 1, r: 20}
],
drawActiveElementsOnTop: false,
backgroundColor: (ctx) => (ctx.dataIndex === 1 ? 'red' : 'blue'),
hoverBackgroundColor: 'yellow',
hoverRadius: 0,
}]
},
options: {
scales: {
x: {
display: false
},
y: {
display: false
},
},
plugins: {
tooltip: false,
legend: false
},
}
},
options: {
canvas: {
width: 256,
height: 256
},
async run(chart) {
const point = chart.getDatasetMeta(0).data[0];
await jasmine.triggerMouseEvent(chart, 'click', {y: point.y, x: point.x + 25});
}
}
};