mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 12:19:08 +02:00
43 lines
774 B
JavaScript
43 lines
774 B
JavaScript
|
module.exports = {
|
||
|
config: {
|
||
|
type: 'bar',
|
||
|
data: {
|
||
|
labels: ['a', 'b', 'c'],
|
||
|
datasets: [
|
||
|
{
|
||
|
data: [220, 250, 225],
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
options: {
|
||
|
events: ['click'],
|
||
|
interaction: {
|
||
|
mode: 'nearest'
|
||
|
},
|
||
|
plugins: {
|
||
|
tooltip: true,
|
||
|
legend: false
|
||
|
},
|
||
|
scales: {
|
||
|
y: {
|
||
|
beginAtZero: false
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
options: {
|
||
|
spriteText: true,
|
||
|
canvas: {
|
||
|
width: 256,
|
||
|
height: 256
|
||
|
},
|
||
|
async run(chart) {
|
||
|
const point = {
|
||
|
x: chart.chartArea.left + chart.chartArea.width / 2,
|
||
|
y: chart.chartArea.top + chart.chartArea.height / 2,
|
||
|
};
|
||
|
await jasmine.triggerMouseEvent(chart, 'click', point);
|
||
|
}
|
||
|
}
|
||
|
};
|