[+] Add opacity param to markline generation

This commit is contained in:
Hykilpikonna
2019-11-09 16:05:25 -05:00
parent 80267feb54
commit 91e10d1fa8
2 changed files with 7 additions and 7 deletions
+6 -6
View File
@@ -22,22 +22,22 @@ export default class GraphUtils
/** /**
* Get mark areas for percentage scores * Get mark areas for percentage scores
*/ */
static getGradeMarkAreas() static getGradeMarkAreas(opacity: number)
{ {
return { return {
silent: true, silent: true,
data: data:
[ [
// Above 100 // Above 100
[{itemStyle: {color: 'rgba(230,253,255,0.09)'}, yAxis: 120}, {yAxis: 100}], [{itemStyle: {color: 'rgba(230,253,255)', opacity: opacity}, yAxis: 120}, {yAxis: 100}],
// 90 to 100 // 90 to 100
[{itemStyle: {color: 'rgba(241,255,237,0.09)'}, yAxis: 100}, {yAxis: 90}], [{itemStyle: {color: 'rgba(241,255,237)', opacity: opacity}, yAxis: 100}, {yAxis: 90}],
// 80 to 90 // 80 to 90
[{itemStyle: {color: 'rgba(255,250,216,0.09)'}, yAxis: 90}, {yAxis: 80}], [{itemStyle: {color: 'rgba(255,250,216)', opacity: opacity}, yAxis: 90}, {yAxis: 80}],
// 70 to 80 // 70 to 80
[{itemStyle: {color: 'rgba(255,225,199,0.1)'}, yAxis: 80}, {yAxis: 70}], [{itemStyle: {color: 'rgba(255,225,199)', opacity: opacity}, yAxis: 80}, {yAxis: 70}],
// Below 70 (Fail) // Below 70 (Fail)
[{itemStyle: {color: 'rgb(255,190,184, 0.09)'}, yAxis: 70}, {yAxis: -100}] [{itemStyle: {color: 'rgb(255,190,184)', opacity: opacity}, yAxis: 70}, {yAxis: -100}]
] ]
} }
} }
@@ -43,7 +43,7 @@ export default class OverallLine extends Vue
{ {
smooth: true, smooth: true,
markLine: GraphUtils.getTermLines(), markLine: GraphUtils.getTermLines(),
markArea: GraphUtils.getGradeMarkAreas() markArea: GraphUtils.getGradeMarkAreas(0.09)
}, },
xAxis: xAxis:
{ {