Skip to content
Advertisement

Change mysql x-axes date to day in chart.js

So I have this code which shows up my Mysql data in chart.js.

Basically everything works but i just want to change the date into days

This is what I have Current Chart And this is what I want to achieve My goal Whatever i try i get never the result i want to get. Here is all of my code:

chart.php

JavaScript

chart.html

JavaScript

chart.js

JavaScript

Any idea to fix my problem?? I would appreciate any answer! Thanks!!

Advertisement

Answer

You can convert the date into a day of the week inside your PHP code using DateTime objects:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement