Please take a look at this gallery page for an example on rendering chart with data fetched from MySQL database. you can also refer to this page for an article about the same.
Please refer to this Stack Overflow thread for more information on fetching last 24 hours’ data from database. You can pass the fetched data to the chart and render it.