-
Notifications
You must be signed in to change notification settings - Fork 0
/
utilsInvoices.ts
120 lines (117 loc) · 2.75 KB
/
utilsInvoices.ts
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
import { ApexOptions } from "apexcharts"
export const optionsLine = (title: string, suffix: string, color: string): ApexOptions => ({
noData: {
text: "No data to show...",
align: 'center',
verticalAlign: 'middle',
offsetX: 0,
offsetY: 0,
style: {
color: "blue",
fontSize: '20px',
}
},
legend: {
position: "top",
horizontalAlign: "center",
},
chart: {
id: 'area-datetime',
type: 'area',
animations: {
enabled: true,
easing: 'easein',
speed: 800,
animateGradually: {
enabled: true,
delay: 150
},
},
toolbar: { show: true, },
},
colors: [color],
stroke: {
curve: 'smooth',
width: 2,
lineCap: 'butt',
},
dataLabels: {
enabled: false
},
xaxis: {
type: 'datetime',
tooltip: {
enabled: false
},
labels: {
show: true,
datetimeUTC: false,
datetimeFormatter: {
year: 'yyyy',
month: "MMM 'yy",
day: 'dd MMM',
hour: 'HH:mm',
},
},
},
tooltip: {
enabled: true,
followCursor: true,
theme: "light",
x: {
show: true,
format: "dd-MM-yyyy HH:mm"
},
y: {
formatter: function (val: number) { return val + suffix },
title: { formatter: () => title },
}
}
})
export const pieOptions: ApexOptions = {
noData: {
text: "You have no data...",
align: 'center',
verticalAlign: 'middle',
offsetX: 0,
offsetY: 0,
style: {
color: "blue",
fontSize: '12px',
}
},
chart: {
height: 390,
type: 'pie',
},
labels: ["Organization Cost", "Tax Cost", "Delivery Cost", "Supplier Cost"],
colors: ["#1984f5", "#00c2f6", "#00cbc8", "#00cbff",],
tooltip: {
enabled: true,
y: { formatter: function (value: number) { return value + " €" }, },
},
legend: {
show: true,
fontSize: '16px',
position: 'right',
labels: {
useSeriesColors: true,
},
formatter: (seriesName: string, opts?: any) => seriesName + " " + opts.w.globals.series[opts.seriesIndex].toFixed(2) + " €",
itemMargin: { vertical: 3 }
},
responsive: [{
breakpoint: 480,
options: {
legend: {
show: false
}
}
}]
}
export interface InvoicesProps {
bills?: any,
cost: any,
aggregated?: any,
filtered?: any
}