diff --git a/WEB/View/src/JS/dashboard.js b/WEB/View/src/JS/dashboard.js index 81e00737..15dc3f35 100644 --- a/WEB/View/src/JS/dashboard.js +++ b/WEB/View/src/JS/dashboard.js @@ -1,4 +1,72 @@ 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 }, + ] + }]*/ + + 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 }, + ] + } + + 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 }, + ] + } + + data = [] + data.push(v1); + data.push(v2); + console.log(data); + var chart = new CanvasJS.Chart("chartContainer", { animationEnabled: true, zoomEnabled: true, @@ -7,7 +75,7 @@ window.onload = function () { text: "Score" }, axisX: { - title: "Enigme", + title: "Temps", valueFormatString: "####", interval: 1 }, @@ -22,43 +90,7 @@ window.onload = function () { verticalAlign: "top", fontSize: 16, }, - 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 }, - ] - } - ] + data }); chart.render(); } \ No newline at end of file