From ee407dee0ca15bc6eb58a4e1353a5f8dc6f81430 Mon Sep 17 00:00:00 2001 From: Kostya Date: Tue, 6 Feb 2024 19:02:09 +0300 Subject: [PATCH] =?UTF-8?q?added=20internet=20dependent=20=D0=BF=C3=90grap?= =?UTF-8?q?h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../games-components/CrashGraphComponent.vue | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/luckydiamond/src/components/games-components/CrashGraphComponent.vue b/luckydiamond/src/components/games-components/CrashGraphComponent.vue index 57b0116..e79e616 100644 --- a/luckydiamond/src/components/games-components/CrashGraphComponent.vue +++ b/luckydiamond/src/components/games-components/CrashGraphComponent.vue @@ -39,6 +39,7 @@ export default { data() { return { dataValues: [], + numberGraph: 1, labels: [" "], data: null, options: { @@ -95,10 +96,21 @@ export default { if (this.crashdata.Status === 'WaitingForPlayers') { this.data = this.chartData; this.labels = [""]; - this.dataValues = [1, 1]; + this.dataValues = [this.numberGraph, this.numberGraph]; } else if (this.crashdata.Status === 'InGame') { - nextDataValue = this.crashdata.CurrentX + if (this.dataValues.length === 0) { + this.dataValues = [this.crashdata.CurrentX, this.crashdata.CurrentX] + nextDataValue = this.crashdata.CurrentX + this.numberGraph = this.crashdata.CurrentX + + this.data = this.chartData + this.labels.push("") + this.dataValues.push(nextDataValue) + } + + this.numberGraph = this.numberGraph + .01 + nextDataValue = this.numberGraph this.data = this.chartData; this.labels.push(""); @@ -106,6 +118,7 @@ export default { } else if (this.crashdata.Status === 'GameEnd') { this.dataValues = [] + this.numberGraph = 1 } else { console.log('Error game')