[F] Fix bar graph -1 problem
This commit is contained in:
@@ -53,15 +53,16 @@ export default class OverallBar extends Vue
|
|||||||
// Data
|
// Data
|
||||||
series:
|
series:
|
||||||
[
|
[
|
||||||
|
// Max GP
|
||||||
{
|
{
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
barGap: '-100%',
|
barGap: '-100%',
|
||||||
data: this.courses.map(course =>
|
data: this.courses.map(course =>
|
||||||
{
|
{
|
||||||
return {value: [course.name, GPAUtils.getGP(course, 'A+')],
|
return {value: [course.name, GPAUtils.getGP(course, 'A+')], itemStyle: {color: '#d8d8d8'}}
|
||||||
itemStyle: {color: '#d8d8d8'}}
|
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
// Current GP
|
||||||
{
|
{
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
barGap: '-100%',
|
barGap: '-100%',
|
||||||
@@ -94,9 +95,16 @@ export default class OverallBar extends Vue
|
|||||||
|
|
||||||
this.courses.forEach(course =>
|
this.courses.forEach(course =>
|
||||||
{
|
{
|
||||||
|
// Get GP
|
||||||
|
let gp = GPAUtils.getGP(course, course.letterGrade);
|
||||||
|
|
||||||
|
// No grade cases
|
||||||
|
if (gp == -1) return;
|
||||||
|
|
||||||
|
// Push data
|
||||||
data.push(
|
data.push(
|
||||||
{
|
{
|
||||||
value: [course.name, GPAUtils.getGP(course, course.letterGrade)],
|
value: [course.name, gp],
|
||||||
itemStyle:
|
itemStyle:
|
||||||
{
|
{
|
||||||
color: Constants.THEME.colors[data.length]
|
color: Constants.THEME.colors[data.length]
|
||||||
|
|||||||
Reference in New Issue
Block a user