Skip to content

Commit eff7b44

Browse files
committed
removes legend
1 parent 92206fb commit eff7b44

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

data.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ import {
99
const allAnswers = getAnswerValue();
1010

1111
(async function () {
12+
const ctx = document.getElementById("data");
13+
1214
const data = [
1315
{ month: "Jan", weight: 250 },
1416
{ month: "Feb", weight: 250 },
1517
{ month: "Jun", weight: 200 }
1618
];
1719

18-
new Chart(document.getElementById("data"), {
20+
new Chart(ctx, {
1921
type: "line",
2022
options: {
2123
pointStyle: false,
@@ -34,27 +36,23 @@ const allAnswers = getAnswerValue();
3436
}
3537
},
3638
y: {
37-
type: "linear",
38-
// beginAtZero: true,
3939
grid: {
4040
display: false
4141
},
4242
ticks: {
4343
count: 2
4444
}
4545
}
46+
},
47+
plugins: {
48+
legend: {
49+
display: false
50+
}
4651
}
4752
},
48-
plugins: {},
4953
data: {
5054
datasets: [
5155
{
52-
label: "Weight loss prediction",
53-
plugins: {
54-
font: {
55-
size: 5
56-
}
57-
},
5856
data: data.map((row) => row.weight)
5957
}
6058
]

0 commit comments

Comments
 (0)