added half-point mark for economy graph
This commit is contained in:
@@ -11,14 +11,15 @@ import {onBeforeMount, onMounted, reactive, watch} from "vue";
|
|||||||
|
|
||||||
import * as echarts from 'echarts/core';
|
import * as echarts from 'echarts/core';
|
||||||
import {
|
import {
|
||||||
|
GridComponent,
|
||||||
|
MarkAreaComponent,
|
||||||
TitleComponent,
|
TitleComponent,
|
||||||
TooltipComponent,
|
TooltipComponent,
|
||||||
GridComponent,
|
|
||||||
VisualMapComponent
|
VisualMapComponent
|
||||||
} from 'echarts/components';
|
} from 'echarts/components';
|
||||||
import { LineChart } from 'echarts/charts';
|
import {LineChart} from 'echarts/charts';
|
||||||
import { UniversalTransition } from 'echarts/features';
|
import {UniversalTransition} from 'echarts/features';
|
||||||
import { CanvasRenderer } from 'echarts/renderers';
|
import {CanvasRenderer} from 'echarts/renderers';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "EqValueGraph",
|
name: "EqValueGraph",
|
||||||
@@ -81,7 +82,7 @@ export default {
|
|||||||
let newArr = []
|
let newArr = []
|
||||||
const half_point = max_rounds / 2 - 1
|
const half_point = max_rounds / 2 - 1
|
||||||
for (let round in team_1) {
|
for (let round in team_1) {
|
||||||
if (round < half_point) {
|
if (round <= half_point) {
|
||||||
newArr.push(team_1[round] - team_2[round])
|
newArr.push(team_1[round] - team_2[round])
|
||||||
} else
|
} else
|
||||||
newArr.push(team_2[round] - team_1[round])
|
newArr.push(team_2[round] - team_1[round])
|
||||||
@@ -106,6 +107,7 @@ export default {
|
|||||||
},
|
},
|
||||||
xAxis: [
|
xAxis: [
|
||||||
{
|
{
|
||||||
|
type: 'category',
|
||||||
data: dataList,
|
data: dataList,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -114,7 +116,7 @@ export default {
|
|||||||
],
|
],
|
||||||
grid: [
|
grid: [
|
||||||
{
|
{
|
||||||
bottom: '60%'
|
bottom: '50%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
top: '60%'
|
top: '60%'
|
||||||
@@ -129,12 +131,31 @@ export default {
|
|||||||
},
|
},
|
||||||
showSymbol: false,
|
showSymbol: false,
|
||||||
data: valueList,
|
data: valueList,
|
||||||
|
markArea: {
|
||||||
|
data: [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
name: 'Half-Point',
|
||||||
|
xAxis: max_rounds / 2 - 1,
|
||||||
|
label: {
|
||||||
|
color: 'white'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
xAxis: max_rounds / 2
|
||||||
|
}
|
||||||
|
]
|
||||||
|
],
|
||||||
|
itemStyle: {
|
||||||
|
color: 'rgba(200,200,200, 0.3)'
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
]
|
],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let myChart1
|
let myChart1, max_rounds
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
data.team.push(getTeamPlayer(store.state.matchDetails.stats, 1))
|
data.team.push(getTeamPlayer(store.state.matchDetails.stats, 1))
|
||||||
@@ -152,10 +173,12 @@ export default {
|
|||||||
VisualMapComponent,
|
VisualMapComponent,
|
||||||
LineChart,
|
LineChart,
|
||||||
CanvasRenderer,
|
CanvasRenderer,
|
||||||
UniversalTransition
|
UniversalTransition,
|
||||||
|
MarkAreaComponent
|
||||||
]);
|
]);
|
||||||
|
|
||||||
myChart1 = echarts.init(document.getElementById('economy-graph'), {}, {width: 1000, height: 800});
|
myChart1 = echarts.init(document.getElementById('economy-graph'), {}, {width: 1000, height: 800});
|
||||||
|
max_rounds = store.state.matchDetails.max_rounds ? store.state.matchDetails.max_rounds : 30
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -163,7 +186,7 @@ export default {
|
|||||||
data.eq_team_1 = sumArr(data.eq_team_player_1)
|
data.eq_team_1 = sumArr(data.eq_team_player_1)
|
||||||
data.eq_team_2 = sumArr(data.eq_team_player_2)
|
data.eq_team_2 = sumArr(data.eq_team_player_2)
|
||||||
|
|
||||||
const valueList = BuildGraphData(data.eq_team_1, data.eq_team_2, store.state.matchDetails.max_rounds ? store.state.matchDetails.max_rounds : 30)
|
const valueList = BuildGraphData(data.eq_team_1, data.eq_team_2, max_rounds)
|
||||||
|
|
||||||
const dataList = Array.from(Array(valueList.length + 1).keys())
|
const dataList = Array.from(Array(valueList.length + 1).keys())
|
||||||
dataList.shift()
|
dataList.shift()
|
||||||
|
Reference in New Issue
Block a user