0

I apologies in advance if this question/query seems trivial. Despite my efforts searching within this forum and others, I still could not find a clear solution of how graphs or charts are included using FPDF.

What I am trying to achieve is to create a pdf report containing charts amongst other data. These charts need to be created dynamically depending on user input.

What I managed so far is to create a plot in pdf using phplot however when I try to include the output of the GDImage within the report, I get displayed only the chart/plot whilst the other contents dissapear. Thus currently I cannot include any graphs within my overall report.

My questions are the following: 1) Is phplot my solution to create graphs for later inclusion using FPDF?

2) If yes to 1) how can I include the resulting GDimage within my report as currently imagedestroy($plot->img);$pdf->Output(); provides only pdf of the image/chart whilst other contents dissapear.

3) If none of the above is correct can you indicate me a solution bearing in mind that I require graph generation on the fly ie, dynamically within the report?

Apologise once again however I am currently lost.

R.Cremona
  • 59
  • 1
  • 7

1 Answers1

0

Issue resolved. For completeness sake the following resolved my issue.

$plot->SetIsInline(true);
$plot->SetOutputFile('file_name');

then you need to place it as an image.

Bharata
  • 13,509
  • 6
  • 36
  • 50
R.Cremona
  • 59
  • 1
  • 7