Hi there,
I am currently creating a page where you can view statistics from a game I made. I am importing date from a MySQL database with the a DateTime row. Now I want to display just the month and day on my x-axis, instead of year, month, day, and the exact time. I know there is a documentation, but I couldn’t find a working solution over there.
I currently have this as the PHP:
//Maak verbinding met server
$servername = "..";
$username = "..";
$password = "..";
$dbname = "..";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM geometry_results WHERE " . $_SESSION['userID'] . " = userID ORDER BY datum asc";
$result = $conn->query($sql);
$dataPoints = array();
if ($result->num_rows > 0) {
// output data of each row
while ($row = $result->fetch_assoc()) {
$results = $row['goed'];
$mes = date(2000, 10, 10);
// $text = 'Time: ' . $row['time'];
array_push($dataPoints, array("y" => ($row['tijd'] / 10), "label" => date($row['datum']), "wins" => $row['goed'], "false" => $row['fout']));
// array_push($dataPoints, array('y' => Date(2012, 02, 02), "label" => $row['datum']));
}
} else {
$results = "0 results";
}
$conn->close();
And this as a script to load the statistics in a line diagram:
https://hastebin.com/ekidupukuq.js
-
This topic was modified 6 years, 11 months ago by timyboy12345.