Skip to content
This repository was archived by the owner on Jul 27, 2024. It is now read-only.

Commit f38d3da

Browse files
committed
added static analytics to the analytics view. right now they are not connected to allcourses, but they still function and present the information needed. all we need to do now is replace datasets>data with the relevant information
1 parent 33e76e7 commit f38d3da

File tree

4 files changed

+61
-43
lines changed

4 files changed

+61
-43
lines changed

Closure_Front_End/src/components/BarChart.vue

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,44 @@
11

22

33
<script>
4-
import { defineComponent } from 'vue';
5-
import { Line } from 'vue3-chart-v2';
6-
4+
import { defineComponent } from "vue";
5+
import { Line } from "vue3-chart-v2";
76
87
export default defineComponent({
9-
name: 'MonthlyChart',
8+
name: "MonthlyChart",
109
extends: Line,
11-
props: {
12-
chartData: {
13-
type: Object,
14-
required: true
15-
},
16-
chartOptions: {
17-
type: Object,
18-
required: false
19-
},
10+
// props: {
11+
// chartData: {
12+
// type: Object,
13+
// required: true
14+
// },
15+
// chartOptions: {
16+
// type: Object,
17+
// required: false
18+
// },
19+
// },
20+
mounted() {
21+
this.renderChart({
22+
labels: [0,1, 2, 3, 4, 5, 6, 7, 8],
23+
datasets: [
24+
{
25+
label: "total points",
26+
backgroundColor: "#999999",
27+
fill: false,
28+
data: [0,25, 56, 70, 80, 90, 105, 125, 134],
29+
xAxisId: "semester",
30+
options: {
31+
scales: {
32+
title:
33+
{
34+
display: true,
35+
text : 'semester',
36+
},
37+
},
38+
},
39+
},
40+
],
41+
});
2042
},
21-
mounted () {
22-
this.renderChart(this.chartData, this.chartOptions)
23-
}
24-
})
43+
});
2544
</script>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
<script>
3+
import { defineComponent } from 'vue';
4+
import { Pie } from 'vue3-chart-v2';
5+
6+
export default defineComponent({
7+
name: 'MonthlyChart',
8+
extends: Pie,
9+
mounted () {
10+
// Overwriting base render method with actual data.
11+
this.renderChart({
12+
labels: ['Must', 'Choose from list', 'Choice'],
13+
datasets: [
14+
{
15+
backgroundColor: ['#bc87d0','#fbaf5d','#f06eaa'],
16+
data: [70, 20, 40]
17+
}
18+
]
19+
})
20+
}
21+
})
22+
</script>

Closure_Front_End/src/views/Analytics.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<div class="columns">
44
<div class="column">
5-
<BarChart/>
5+
<PieChart/>
66
</div>
77
<div class="column">
88
<LineChart/>
@@ -17,12 +17,12 @@
1717
</template>
1818

1919
<script>
20-
import BarChart from "../components/BarChart.vue";
20+
import PieChart from "../components/PieChart.vue";
2121
import LineChart from "../components/LineChart.vue";
2222
2323
export default {
2424
name: "Analytics",
25-
components: { BarChart,LineChart },
25+
components: { PieChart,LineChart },
2626
data() {},
2727
2828
methods: {},

0 commit comments

Comments
 (0)