-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replaced const of chart config to info dashboard directory
- Loading branch information
Yehor Podporinov
authored and
Yehor Podporinov
committed
Apr 8, 2024
1 parent
c6b5f47
commit ba1bb80
Showing
4 changed files
with
62 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { type ChartConfig } from '@/types' | ||
|
||
export const CHART_CONFIG: Readonly<ChartConfig> = 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: [], | ||
}, | ||
], | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters