max_execution_time int
This sets the maximum time in seconds a script is allowed to run before it is terminated by the parser. This helps prevent poorly written scripts from tying up the server. The default setting is 30. When running PHP from the command line the default setting is 0.
<script >
let chartArray = "<?= json_encode($array)?>";
</script>
Как формируется ссылка на бэкенде? отредактируйте формат сохранения.
Докментация.