|
|
@ -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) {
|
|
|
|
|
|
|
|
v = {}
|
|
|
|
|
|
|
|
v.type="line";
|
|
|
|
|
|
|
|
v.xValueFormatString=players[2];
|
|
|
|
///v3={type:"line",xValueFormatString:"test",dataPoints};
|
|
|
|
v.dataPoints=[];
|
|
|
|
|
|
|
|
}
|
|
|
|
data = [];
|
|
|
|
// v.dataPoints.push({x:0,y:0});
|
|
|
|
|
|
|
|
// v.dataPoints.push({x:0.5,y:300});
|
|
|
|
v = {}
|
|
|
|
// data.push(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);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
v = {}
|
|
|
|
if (players[3] != null) {
|
|
|
|
v.type="line";
|
|
|
|
v = {}
|
|
|
|
v.xValueFormatString="toto";
|
|
|
|
v.type="line";
|
|
|
|
v.dataPoints=[{ x: 0, y: 0 },
|
|
|
|
v.xValueFormatString=players[3];
|
|
|
|
{ x: 1, y: 100 },
|
|
|
|
v.dataPoints=[];
|
|
|
|
{ x: 2, y: 100 },
|
|
|
|
}
|
|
|
|
{ x: 3, y: 200 },
|
|
|
|
// v.dataPoints.push({x:0,y:0});
|
|
|
|
{ x: 4, y: 250 },
|
|
|
|
// v.dataPoints.push({x:0.5,y:300});
|
|
|
|
{ x: 5, y: 300 },];
|
|
|
|
// data.push(v);
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
},
|
|
|
|
},
|
|
|
|