Actually, everything is pretty straightforward and there are many workarounds out there involving PHP, Ajax, Node.js, etc. This just-published tutorial explains how to use PHP to load data to a JS chart from a MySQL database, providing clear instructions covering the following steps:
- Create a PHP script.
- Declare MySQL database variables.
- Connect to the database.
- Query the database.
- Create data from the query.
- Encode data to the JSON format.
- Close the connection.
- Draw the chart in JS.
Code samples are also available along the tutorial.
See the full tutorial here. Feel free to ask questions there or here if anything remains unclear.