01.
$graph
=
new
PieGraph(750,750);
02.
$graph
->SetShadow();
03.
04.
$data
=
array
(24.6,25.3,50.1);
05.
$labels
=
array
(
"First\n(%.1f%%)"
,
"Second\n(%.1f%%)"
,
"Third\n(%.1f%%)"
);
06.
$labels2
=
array
(
"%.1f%%"
,
"%.1f%%"
,
"%.1f%%"
);
07.
08.
$p1
=
new
PiePlot(
$data
);
09.
$p1
->SetSize(0.3);
10.
11.
$graph
->title->SetFont(FF_FONT2,FS_BOLD, 40);
12.
$graph
->title->Set(
'test'
);
13.
14.
15.
16.
17.
18.
19.
20.
21.
$p1
->SetLabels(
$labels
);
22.
23.
$p1
->SetLabelPos(1);
24.
$p1
->SetCenter(0.5, 0.4);
25.
26.
$p1
->SetGuideLines(true,false);
27.
$p1
->SetGuideLinesAdjust(1.5);
28.
29.
$p1
->SetLegends(
$labels2
);
30.
31.
$graph
->legend->SetPos(0,0.1,
'right'
,
'top'
);
32.
$graph
->legend->SetColumns(1);
33.
34.
$p1
->SetLabelType(PIE_VALUE_PER);
35.
$p1
->value->Show();
36.
$p1
->value->SetFont(FF_ARIAL,FS_NORMAL,8);
37.
$p1
->value->SetColor(
'darkgray'
);
38.
39.
$graph
->Add(
$p1
);
40.
$graph
->Stroke();