tbl_chart.php fetches the whole data set generated by the query and puts it into an array. Then, this is passed to the js level for chart generation. Evidently, the web server's process and the browser itself hit memory limits, even for medium tables (sakila.film_actor).
I'm not sure what the user expects when clicking on "Display chart" in terms of the number of rows, because, for example "Query results operations>Print view" only displays the current rows on screen (30 by default).
So I suggest to do something similar to what was done in Search>Zoom search: to have in the chart interface a control for the maximum number
of rows, with 500 as the default value.