added internet dependent пÐgraph

This commit is contained in:
Kostya
2024-02-06 19:02:09 +03:00
parent da3de874fa
commit ee407dee0c

View File

@@ -39,6 +39,7 @@ export default {
data() { data() {
return { return {
dataValues: [], dataValues: [],
numberGraph: 1,
labels: [" "], labels: [" "],
data: null, data: null,
options: { options: {
@@ -95,10 +96,21 @@ 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 = [1, 1]; this.dataValues = [this.numberGraph, this.numberGraph];
} }
else if (this.crashdata.Status === 'InGame') { else if (this.crashdata.Status === 'InGame') {
if (this.dataValues.length === 0) {
this.dataValues = [this.crashdata.CurrentX, this.crashdata.CurrentX]
nextDataValue = 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.data = this.chartData;
this.labels.push(""); this.labels.push("");
@@ -106,6 +118,7 @@ export default {
} }
else if (this.crashdata.Status === 'GameEnd') { else if (this.crashdata.Status === 'GameEnd') {
this.dataValues = [] this.dataValues = []
this.numberGraph = 1
} }
else { else {
console.log('Error game') console.log('Error game')