diff --git a/src/common/InfoDashboard/const.ts b/src/common/InfoDashboard/const.ts new file mode 100644 index 00000000..93709c0d --- /dev/null +++ b/src/common/InfoDashboard/const.ts @@ -0,0 +1,60 @@ +import { type ChartConfig } from '@/types' + +export const CHART_CONFIG: Readonly = Object.freeze({ + type: 'line', + options: { + maintainAspectRatio: false, + plugins: { + legend: { display: false }, + }, + scales: { + x: { + border: { + dash: [2], + }, + grid: { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + color: (ctx: any) => { + return ctx.index === 0 || (ctx.index + 1) % 5 === 0 + ? '#b1b1b1' + : '#4f4f4f' + }, + }, + ticks: { + color: '#ffffff', + autoSkip: false, + maxRotation: 0, + callback: function (value: unknown, idx: number) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const label = (this as any).getLabelForValue(value) + return idx === 0 || (idx + 1) % 5 === 0 ? label : '' + }, + }, + }, + y: { + border: { + dash: [2], + }, + grid: { + color: '#4f4f4f', + }, + ticks: { + color: '#ffffff', + callback: (val: unknown) => String(val).replace(/000$/, 'K'), + stepSize: 5000, + }, + }, + }, + }, + data: { + datasets: [ + { + backgroundColor: 'transparent', + borderColor: '#ff7c03', + pointBackgroundColor: '#ff7c03', + pointRadius: 4, + data: [], + }, + ], + }, +}) diff --git a/src/common/InfoDashboard/index.vue b/src/common/InfoDashboard/index.vue index 6731c01c..8cab10b9 100644 --- a/src/common/InfoDashboard/index.vue +++ b/src/common/InfoDashboard/index.vue @@ -67,7 +67,6 @@