I am using a 3rd party library to build a chart. The image is displayed when the following is run $chart->render();
This will output the raw image directly. I am trying to print the base64 encoding for this image but i cannot seem to get it to work.
Trying this:
$raw = $chart->render();
$data = 'data:image/png;base64,' . base64_encode($raw);
echo $data;
However, the output is still the raw image and not the base64 encoding.. any ideas?