Test du dashboard
continuous-integration/drone/push Build is failing Details

ServeurDeTest
Noé GARNIER 2 years ago
parent 088e43649f
commit 4aa4f54354

@ -53,5 +53,5 @@ $error = "";
// Server // Server
$serverAdress = "82.165.180.114"; $serverAdress = "82.165.180.114";
$playerNumberPerGame = 3; $playerNumberPerGame = 2;
$nbEnigmePerGame = 1; $nbEnigmePerGame = 1;

@ -1,97 +1,66 @@
window.onload = function () { window.onload = function () {
/*data = [{ var xhr = new XMLHttpRequest();
type: "line", xhr.open('POST', 'http://82.165.180.114/Scripted/index.php?action=getPlayersPseudo', true);
xValueFormatString: "Pierre", xhr.responseType = 'text';
dataPoints: [ xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
{ x: 0, y: 0 }, xhr.onload = function () {
{ x: 1, y: 50 }, var players = JSON.parse(xhr.responseText);
{ x: 2, y: 100 }, // if (players[0] != null) {
{ x: 3, y: 150 }, // var player1 = players[0];
{ x: 4, y: 150 }, // }
{ x: 5, y: 200 }, // if (players[1] != null) {
] // var player2 = players[1];
}, // }
{ // if (players[2] != null) {
type: "line", // var player3 = players[2];
xValueFormatString: "Noe", // }
dataPoints: [ // if (players[3] != null) {
{ x: 0, y: 0 }, // var player4 = players[3];
{ x: 1, y: 100 }, // }
{ x: 2, y: 100 }, };
{ x: 3, y: 200 }, xhr.send(null);
{ x: 4, y: 250 }, data = [];
{ x: 5, y: 300 },
]
},
{
type: "line",
xValueFormatString: "Nathan",
dataPoints: [
{ x: 0, y: 0 },
{ x: 1, y: 75 },
{ x: 2, y: 100 },
{ x: 3, y: 150 },
{ x: 4, y: 200 },
{ x: 5, y: 250 },
]
}]*/
v1 = { if (players[0] != null) {
type: "line", v = {}
xValueFormatString: "Pierre", v.type="line";
dataPoints: [ v.xValueFormatString=players[0];
{ x: 0, y: 0 }, v.dataPoints=[];
{ x: 1, y: 50 },
{ x: 2, y: 100 },
{ x: 3, y: 150 },
{ x: 4, y: 150 },
{ x: 5, y: 200 },
]
} }
// v.dataPoints.push({x:0,y:0});
// v.dataPoints.push({x:0.5,y:300});
// data.push(v);
if (players[1] != null) {
v2 = { v = {}
type: "line", v.type="line";
xValueFormatString: "Noe", v.xValueFormatString=players[1];
dataPoints: [ v.dataPoints=[];
{ x: 0, y: 0 },
{ x: 1, y: 100 },
{ x: 2, y: 100 },
{ x: 3, y: 200 },
{ x: 4, y: 250 },
{ x: 5, y: 300 },
]
} }
// v.dataPoints.push({x:0,y:0});
// v.dataPoints.push({x:0.5,y:300});
// data.push(v);
///dataPoints=[{x:0,y:0},{x:1,y:300}] if (players[2] != null) {
///v3={type:"line",xValueFormatString:"test",dataPoints};
data = [];
v = {} v = {}
v.type="line"; v.type="line";
v.xValueFormatString="test"; v.xValueFormatString=players[2];
v.dataPoints=[]; v.dataPoints=[];
v.dataPoints.push({x:0,y:0}); }
v.dataPoints.push({x:0.5,y:300}); // v.dataPoints.push({x:0,y:0});
// v.dataPoints.push({x:0.5,y:300});
data.push(v); // data.push(v);
if (players[3] != null) {
v = {} v = {}
v.type="line"; v.type="line";
v.xValueFormatString="toto"; v.xValueFormatString=players[3];
v.dataPoints=[{ x: 0, y: 0 }, v.dataPoints=[];
{ x: 1, y: 100 }, }
{ x: 2, y: 100 }, // v.dataPoints.push({x:0,y:0});
{ x: 3, y: 200 }, // v.dataPoints.push({x:0.5,y:300});
{ x: 4, y: 250 }, // data.push(v);
{ x: 5, y: 300 },];
data.push(v);
///data.push(v3);
console.log(data); console.log(data);
var chart = new CanvasJS.Chart("chartContainer", { var chart = new CanvasJS.Chart("chartContainer", {
@ -102,7 +71,7 @@ window.onload = function () {
text: "Score" text: "Score"
}, },
axisX: { axisX: {
title: "Temps", title: "Enigme",
valueFormatString: "####", valueFormatString: "####",
interval: 1 interval: 1
}, },

Loading…
Cancel
Save