File size: 742 Bytes
1c0c94d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import {
  ArcElement,
  BarElement,
  CategoryScale,
  Chart as ChartJS,
  Legend,
  LineElement,
  LinearScale,
  PointElement,
  Title,
  Tooltip,
} from 'chart.js'

ChartJS.register(
  BarElement,
  ArcElement,
  LineElement,
  PointElement,
  CategoryScale,
  LinearScale,
  Title,
  Tooltip,
  Legend,
)

export const baseOptions = (title) => ({
  responsive: true,
  plugins: {
    title: { display: true, text: title, color: '#e6edf6' },
    legend: { labels: { color: '#aab6c8' } },
  },
})

export const axisOptions = (title) => ({
  ...baseOptions(title),
  scales: {
    x: { ticks: { color: '#93a4bd' }, grid: { color: '#1d273b' } },
    y: { ticks: { color: '#93a4bd' }, grid: { color: '#1d273b' }, beginAtZero: true },
  },
})