@@ -7,12 +7,14 @@ import {
7
7
Chart as ChartJS ,
8
8
ChartOptions ,
9
9
defaults ,
10
+ Filler ,
10
11
Legend ,
11
12
LinearScale ,
12
- BarElement ,
13
+ LineElement ,
13
14
TimeScale ,
14
15
Title ,
15
16
Tooltip ,
17
+ PointElement ,
16
18
} from "chart.js" ;
17
19
import "chartjs-adapter-date-fns" ;
18
20
import {
@@ -22,13 +24,15 @@ import {
22
24
} from "components/HelpTooltip/HelpTooltip" ;
23
25
import dayjs from "dayjs" ;
24
26
import { FC } from "react" ;
25
- import { Bar } from "react-chartjs-2" ;
27
+ import { Line } from "react-chartjs-2" ;
26
28
27
29
ChartJS . register (
28
30
CategoryScale ,
29
31
LinearScale ,
30
32
TimeScale ,
31
- BarElement ,
33
+ LineElement ,
34
+ PointElement ,
35
+ Filler ,
32
36
Title ,
33
37
Tooltip ,
34
38
Legend ,
@@ -52,7 +56,7 @@ export const DAUChart: FC<DAUChartProps> = ({ daus }) => {
52
56
defaults . font . family = theme . typography . fontFamily as string ;
53
57
defaults . color = theme . palette . text . secondary ;
54
58
55
- const options : ChartOptions < "bar " > = {
59
+ const options : ChartOptions < "line " > = {
56
60
responsive : true ,
57
61
plugins : {
58
62
legend : {
@@ -70,11 +74,12 @@ export const DAUChart: FC<DAUChartProps> = ({ daus }) => {
70
74
} ,
71
75
scales : {
72
76
y : {
73
- min : 0 ,
77
+ suggestedMin : 0 ,
74
78
ticks : {
75
79
precision : 0 ,
76
80
} ,
77
81
} ,
82
+
78
83
x : {
79
84
ticks : {
80
85
stepSize : daus . entries . length > 10 ? 2 : undefined ,
@@ -89,20 +94,19 @@ export const DAUChart: FC<DAUChartProps> = ({ daus }) => {
89
94
} ;
90
95
91
96
return (
92
- < Bar
97
+ < Line
93
98
data-chromatic = "ignore"
94
99
data = { {
95
100
labels : labels ,
96
101
datasets : [
97
102
{
98
103
label : "Daily Active Users" ,
99
104
data : data ,
100
- backgroundColor : theme . palette . secondary . dark ,
101
- borderColor : theme . palette . secondary . dark ,
102
- barThickness : 8 ,
103
- borderWidth : 2 ,
104
- borderRadius : Number . MAX_VALUE ,
105
- borderSkipped : false ,
105
+ pointBackgroundColor : theme . palette . info . light ,
106
+ pointBorderColor : theme . palette . info . light ,
107
+ borderColor : theme . palette . info . light ,
108
+ backgroundColor : theme . palette . info . dark ,
109
+ fill : "origin" ,
106
110
} ,
107
111
] ,
108
112
} }
@@ -120,7 +124,7 @@ export const DAUTitle = () => {
120
124
How do we calculate daily active users?
121
125
</ HelpTooltipTitle >
122
126
< HelpTooltipText >
123
- When a connection is initiated to a user{ "'" } s workspace they are
127
+ When a connection is initiated to a user' s workspace they are
124
128
considered a daily active user. e.g. apps, web terminal, SSH
125
129
</ HelpTooltipText >
126
130
</ HelpTooltip >
0 commit comments