Chartjs-What's an efficient process for passing PHP arrays to to populate multiple ChartJS graphs?

1👍

Just send the arrays to the browser using

echo json_encode( $data );

You would probably want to store that in a hidden field somewhere. After the page is loaded kick off the JS to actually load the charts. I am not very familiar with PhP or ChartJS but this seems like the standard way to pass data from the server to the browser. If I missed the mark and didn’t answer your question feel free to ask a follow up and ill do my best to help out.

Leave a comment