added info in graph crash

This commit is contained in:
Kostya
2024-02-04 15:48:33 +03:00
parent 2ec5085a71
commit d33836ac80

View File

@@ -1,10 +1,11 @@
<template> <template>
<div v-if="crashdata.Status === 'WaitingForPlayers'"><h2>Игра не началась</h2></div> <div v-if="crashdata.Status === 'WaitingForPlayers'"><h2>{{ crashdata.WaitingTime ? crashdata.WaitingTime.toFixed(1) : '' }}</h2></div>
<LineChart <LineChart
:chart-data="data" :chart-data="data"
:options="options" :options="options"
v-else v-else
/> />
<h2>{{ crashdata.CurrentX ? crashdata.CurrentX.toFixed(2) : '' }}</h2>
</template> </template>
<script> <script>
@@ -37,7 +38,7 @@ export default {
}, },
data() { data() {
return { return {
dataValues: [], dataValues: [0,],
labels: [""], labels: [""],
data: null, data: null,
options: { options: {
@@ -87,7 +88,7 @@ export default {
if (this.crashdata.Status === 'WaitingForPlayers') { if (this.crashdata.Status === 'WaitingForPlayers') {
this.data = this.chartData; this.data = this.chartData;
this.labels = [""]; this.labels = [""];
this.dataValues = [0]; this.dataValues = [0, 0];
} }
else if (this.crashdata.Status === 'InGame') { else if (this.crashdata.Status === 'InGame') {
nextDataValue = this.crashdata.CurrentX nextDataValue = this.crashdata.CurrentX