RoncalJustin

How do i include the Fusion Chart on a PDF Report Generated by TCPDF

Recommended Posts

$pdf->AddPage();
                $fusionCharts_HTML='
        <?
                require_once(INCLUDE_DIR.'.'fusioncharts.php'.');
 
        $plots = $report->getPlotData();
        $ticket_projects = $report->getTicketProjects();
        $project_selected = $report->getProjects();

        $pieData = $report->getPieChart($ticket_projects);
        $jsonEncodedData = json_encode($pieData);
        $columnChart = new FusionCharts("pie3d", "ncmreportsummary" , 900, 450, "chart-1", "json",$jsonEncodedData);
       
        $columnChart->render();
        ?>
        <div class="centered">
            <div id="chart-1"><!-- Fusion Charts will render here--></div>
        </div>
        <?php';

        $html2='<div class="centered">'.$fusionCharts_HTML.'
                </div>';


                // output the HTML content
        $pdf->writeHTML($html2, true, false, true, false, '');

        // reset pointer to the last page
        $pdf->lastPage();

Share this post


Link to post
Share on other sites
On 12/4/2017 at 11:11 AM, RoncalJustin said:

$pdf->AddPage();
                $fusionCharts_HTML='
        <?
                require_once(INCLUDE_DIR.'.'fusioncharts.php'.');
 
        $plots = $report->getPlotData();
        $ticket_projects = $report->getTicketProjects();
        $project_selected = $report->getProjects();

        $pieData = $report->getPieChart($ticket_projects);
        $jsonEncodedData = json_encode($pieData);
        $columnChart = new FusionCharts("pie3d", "ncmreportsummary" , 900, 450, "chart-1", "json",$jsonEncodedData);
       
        $columnChart->render();
        ?>
        <div class="centered">
            <div id="chart-1"><!-- Fusion Charts will render here--></div>
        </div>
        <?php';

        $html2='<div class="centered">'.$fusionCharts_HTML.'
                </div>';


                // output the HTML content
        $pdf->writeHTML($html2, true, false, true, false, '');

        // reset pointer to the last page
        $pdf->lastPage();

Please refer this forum post.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now