-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconstants.js
69 lines (64 loc) · 1.38 KB
/
constants.js
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
import { k } from "./utils";
export const docs = "https://docs.simpleanalytics.com/embed-chart-on-your-site";
export const host = "https://simpleanalytics.com";
export const options = {
interaction: {
intersect: false,
mode: "index",
},
animation: {
duration: 0,
},
elements: {
line: {
tension: 0,
},
},
scales: {
y: {
display: true,
beginAtZero: true,
ticks: {
callback: function (label) {
if (Math.floor(label) === label) return k(label);
},
},
},
x: {
display: true,
type: "time",
time: { tooltipFormat: "MMMM d, yyyy" },
ticks: {
maxRotation: 0,
},
},
},
plugins: {
legend: {
display: false,
},
tooltip: {
displayColors: false,
callbacks: {
label: function (context) {
let label = context.dataset.label || "";
if (label) {
label += ": ";
}
if (context.parsed.y !== null) {
label += k(context.parsed.y);
}
return label;
},
},
},
},
};
const blueDark = "#24acfc";
const blueLight = "#abe0ff";
const greenBlueDark = "#00c5e5";
const greenBlueLight = "#dff6fa";
export const colors = {
pageViews: { border: blueDark, background: blueLight },
visitors: { border: greenBlueDark, background: greenBlueLight },
};