julles/laravel-highcharts

Chart Display on PDF

Closed this issue · 14 comments

How to view generated chart on pdf?

I've added a feature button export
update package :

composer update muhamadrezaar/highcharts

by default, the download button Highcharts existing
alt tag

Thanks, but my flow goes like this, from laravel controller I send a json responses to pdf view which the highchart is included together inside the json response.. Im planning to convert the generated svg chart into base64 image and show it at the pdf view.. Is there any best way I could make this happen? Thanks

How I can get its svg file at controller?

sorry I'm working right now, maybe later tonight (Indonesian time) I will try to find a solution for it :)

I've added a chat feature to svg
example :

<?php echo Chart::display("id", $charts,['format' => 'svg']); ?>

dont forget update package

Hi it's great reza..! yet another thing, I am not able to convert to base64 and embed it to pdf viewer.. is the format 'svg' can be changed like 'pdf'/'png'/'jpeg'?

A. Create route only display highchart

Route::get('base64' , function(){
echo Chart::display("myId", $charts,['format' => 'base64']);
});

B. create default route

Route::get('result',function(){
    $base64= file_get_contents(url('base64'));
    // what do you want to manipulation base64 code ,generate or process anything here
});

C. Dont forget update package

Why created two routes?
because helper Chart::display() returning javascript script
The second route taking existing content on Route 1, and then be made variable using file_get_contents().

sorry my english is bad hahaha

it is possible to save the chart as an image and then put it in pdf?

read my comment above :)

sorry my english is bad :D

any idea?

A. Create route only display highchart

Route::get('base64' , function(){
echo Chart::display("myId", $charts,['format' => 'base64']);
});

B. create default route

Route::get('result',function(){
    $base64= file_get_contents(url('base64'));
    // what do you want to manipulation base64 code ,generate or process anything here
});

the above script does not work?

@zahidaziz16 did u figure a way to do this ?