<?php // content="text/plain; charset=utf-8" // $Id: piecex2.php,v 1.3.2.1 2003/08/19 20:40:12 aditus Exp $ // Example of pie with center circle require_once '../../vendor/autoload.php'; use Amenadiel\JpGraph\Graph; use Amenadiel\JpGraph\Plot; // Some data $data = array(50, 28, 25, 27, 31, 20); // A new pie graph $graph = new Graph\PieGraph(400, 400, 'auto'); // Don't display the border $graph->SetFrame(false); // Uncomment this line to add a drop shadow to the border // $graph->SetShadow(); // Setup title $graph->title->Set("Plot\\PiePlotC"); $graph->title->SetFont(FF_ARIAL, FS_BOLD, 18); $graph->title->SetMargin(8); // Add a little bit more margin from the top // Create the pie plot $p1 = new Plot\PiePlotC($data); // Set size of pie $p1->SetSize(0.35); // Label font and color setup $p1->value->SetFont(FF_ARIAL, FS_BOLD, 12); $p1->value->SetColor('white'); $p1->value->Show(); // Setup the title on the center circle $p1->midtitle->Set("Test mid\nRow 1\nRow 2");