[O] Remove dataset, move data to series

This commit is contained in:
Hykilpikonna
2019-09-29 18:02:40 -04:00
parent 7b4ced4e94
commit cc5b7b2793
@@ -16,17 +16,6 @@ export default class GraphAverage extends Vue
{ {
let settings = let settings =
{ {
// Dataset
dataset:
{
source: this.courses.map(course =>
{
// [Course name, GPA, MaxGPA]
return [course.name, GPAUtils.getGP(course, course.letterGrade),
GPAUtils.getGP(course, 'A+')];
})
},
// X axis represents course names // X axis represents course names
xAxis: xAxis:
{ {
@@ -48,14 +37,31 @@ export default class GraphAverage extends Vue
}, },
// Data // Data
series: [2, 1].map(i => series:
{ [
return { {
type: 'bar', type: 'bar',
barGap: '-100%', barGap: '-100%',
encode: {x: 0, y: i} data: this.courses.map(course => [course.name, GPAUtils.getGP(course, 'A+')]),
},
{
type: 'bar',
barGap: '-100%',
data: this.courses.map(course => [course.name, GPAUtils.getGP(course, course.letterGrade)]),
label:
{
show: true,
rotate: 90
}
} }
}) ],
// Disable tooltip
tooltip:
{
show: false
}
}; };
// TODO: Remove this // TODO: Remove this