0👍
try
data: val.dataset.data
rather than
data: val
It appears you’re just popping the entire json into the val field, rather than isolating the data portion needed for plotting
- Chartjs-Edge browser does not render chart using chart js
- Chartjs-Execute SQL prepared statement in AJAX
0👍
The problem was that the response from php was actually a string. Chart() requires data to be an object, so constructing an array in php with relevant data and using json_encode() allowed the data property to be filled with values from the server.
Source:stackexchange.com