Skip to content

Commit 3195d87

Browse files
committed
feat: increase size of y-axis fonts
refactor: tree-shaking to support only line chart
1 parent e6386c1 commit 3195d87

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

data.js

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
import Chart from "chart.js/auto";
1+
import {
2+
Chart,
3+
LineElement,
4+
PointElement,
5+
CategoryScale,
6+
LinearScale
7+
} from "chart.js/auto";
28
import {
39
getAllAnswerValues,
410
setAutoHeight
@@ -18,14 +24,16 @@ async function loadClientConfig() {
1824
* {
1925
* labels: ['January', 'February', 'March', 'April', 'May'],
2026
* data: {
21-
datasets: [
22-
{
23-
data: [300, 300, 200]
24-
}
25-
]
27+
datasets: [
28+
{
29+
data: [300, 300, 200]
30+
}
31+
]
2632
}
27-
* }
28-
*/
33+
* }
34+
*/
35+
36+
Chart.register(CategoryScale, LinearScale, PointElement, LineElement);
2937

3038
const options = {
3139
pointStyle: false,
@@ -48,7 +56,10 @@ const options = {
4856
},
4957
ticks: {
5058
count: 2,
51-
crossAlign: "near"
59+
crossAlign: "near",
60+
font: {
61+
size: 16
62+
}
5263
}
5364
}
5465
},
@@ -59,6 +70,7 @@ const options = {
5970
}
6071
};
6172

73+
// Default values are handled in the chart_data variable
6274
// const defaultData = {
6375
// datasets: [
6476
// {

0 commit comments

Comments
 (0)