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
$serverAdress = "82.165.180.114";
$playerNumberPerGame = 3;
$playerNumberPerGame = 2;
$nbEnigmePerGame = 1;

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

Loading…
Cancel
Save