mirror of
https://github.com/Ryujinx/Ryujinx-Website.git
synced 2024-06-02 21:28:47 +02:00
Fix typescript errors
This commit is contained in:
parent
a39f9add31
commit
17ebd5239d
7
src/chartjs.d.ts
vendored
Normal file
7
src/chartjs.d.ts
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
import type { TooltipPositionerFunction } from 'chart.js';
|
||||
|
||||
declare module 'chart.js' {
|
||||
interface TooltipPositionerMap {
|
||||
cursor: TooltipPositionerFunction<ChartType>;
|
||||
}
|
||||
}
|
|
@ -7,7 +7,7 @@ import { Doughnut } from "vue-chartjs";
|
|||
import { Chart, ArcElement, Title, Legend, Tooltip, Colors, ChartData, ChartOptions, elements } from 'chart.js'
|
||||
|
||||
Chart.register(ArcElement, Title, Legend, Tooltip, Colors);
|
||||
Tooltip.positioners.mousePosition = function(elements, eventPosition) {
|
||||
Tooltip.positioners.cursor = function(elements, eventPosition) {
|
||||
return {
|
||||
x: eventPosition.x,
|
||||
y: eventPosition.y
|
||||
|
@ -146,7 +146,7 @@ const chartOptions = {
|
|||
},
|
||||
tooltip: {
|
||||
usePointStyle: true,
|
||||
position: 'mousePosition',
|
||||
position: "cursor" as const,
|
||||
bodyFont: {
|
||||
family: "Inter",
|
||||
size: 12
|
||||
|
@ -157,7 +157,7 @@ const chartOptions = {
|
|||
}
|
||||
}
|
||||
},
|
||||
onClick: (e, activeEls) => {
|
||||
onClick: (e: any, activeEls: any) => {
|
||||
let datasetIndex = activeEls[0].datasetIndex;
|
||||
let dataIndex = activeEls[0].index;
|
||||
let value = e.chart.data.datasets[datasetIndex].data[dataIndex];
|
||||
|
|
Loading…
Reference in New Issue
Block a user