<?php
 
require_once "jpgraph/jpgraph.php";
require_once "jpgraph/jpgraph_pie.php";
require_once "jpgraph/jpgraph_pie3d.php";
 
// データ
$org_data = array(
  "PHP"         => 126,
  "JavaScript"  => 48,
  "JAVA"        => 41,
  "Ruby"        => 32,
  "C/C++"       => 31,
  "Perl"        => 25,
  "C++"         => 15,
  "Python"      => 9,
);
$data = array_values($org_data);
$legends = array_keys($org_data);
$color_list = array('#FF0F00','#FF6600','#FF9E01','#FCD202','#B0DE09','#03D215','#0D8ECF', '#0012DF');
 
//グラフ設定
$graph = new PieGraph(405, 250);
$graph->title->SetFont(FF_PGOTHIC);
$graph->title->Set("好きなプログラム言語 (仮) ");
$graph->SetMarginColor("#ffffff");
$graph->SetShadow(true, 4, "gray");
$graph->SetAntiAliasing();
$graph->legend->SetPos(0.05, 0.05);
 
//プロット設定
$p1 = new PiePlot3D($data);
$p1->SetAngle(65);
$p1->SetSize(0.48);
$p1->SetCenter(0.45,0.52);
$p1->SetStartAngle(90);
$p1->ExplodeSlice(0);
$p1->value->SetFont(FF_FONT1);
$p1->value->SetColor("#eeeeee");
$p1->SetLabelPos(0.45);
$p1->SetSliceColors($color_list);
$p1->SetLegends($legends);
 
$graph->Add($p1);
$graph->Stroke();
 
?>