[M] Move markline stuff to GraphUtils

This commit is contained in:
Hykilpikonna
2019-11-09 15:47:30 -05:00
parent 82cb845061
commit d698f3d13a
2 changed files with 23 additions and 11 deletions
+21
View File
@@ -0,0 +1,21 @@
import Constants from '@/constants';
export default class GraphUtils
{
/**
* Get term mark lines
*/
static getTermLines()
{
return {
silent: true,
symbol: 'none',
lineStyle: {color: Constants.THEME.colors[2]},
animationDuration: 500,
data: Constants.TERMS.map((term, index) =>
{
return {xAxis: term.getTime(), label: {formatter: `Term ${index + 1}`}}
})
}
}
}
+2 -11
View File
@@ -4,6 +4,7 @@ import Course from '@/logic/course';
import Constants from '@/constants';
import Navigation from '@/components/navigation/navigation';
import {CourseUtils} from '@/logic/utils/course-utils';
import GraphUtils from '@/logic/utils/graph-utils';
@Component({
})
@@ -43,17 +44,7 @@ export default class OverallLine extends Vue
smooth: true,
// Quarter lines
markLine:
{
silent: true,
symbol: 'none',
lineStyle: {color: Constants.THEME.colors[2]},
animationDuration: 500,
data: Constants.TERMS.map((term, index) =>
{
return {xAxis: term.getTime(), label: {formatter: `Term ${index + 1}`}}
})
},
markLine: GraphUtils.getTermLines(),
// Mark area
markArea: