I tried following the tutorial found on here: https://www.sitepoint.com/charting-with-pchart/
I got up to but didn't start the "Three-Series Chart" section. Just before that, it says that my browser should show a chart similar to the one below:
This is what outputs on my screen however:
Yes it may look like a blank screen, but if you look closely in the top left corner, there's a tiny square.
Here is my code (I copied all of it from each individual step in the tutorial. What is wrong here?
<?php
session_start();
define("PCHART_PATH", "/var/www/html/pChart2.1.4");
set_include_path(get_include_path() . PATH_SEPARATOR . PCHART_PATH);
require_once "class/pDraw.class.php";
require_once "class/pImage.class.php";
require_once "class/pData.class.php";
$myDataset = array(0, 1, 1, 2, 3, 5, 8, 13);
$myData = new pData();
$myData->addPoints($myDataset);
$myImage = new pImage(500, 300, $myData);
$myImage->setFontProperties(array(
"FontName" => PCHART_PATH . "var/www/html/pChart2.1.4/fonts/GeosansLight.ttf",
"FontSize" => 15));
$myImage->setGraphArea(25,25, 475,275);
$myImage->drawScale();
$myImage->drawBarChart();
header("Content-Type: image/png");
$myImage->Render(null);
?>
It turns out that if you have an echo statement somewhere in the php code, that's what produces the little box to appear. I removed the echo statement and it works now. I updated the code in the question