<?php
// prilinkovani potrebnych knihoven pro vykresleni 3D kolace
include ("../jpgraph.php");
include ("../jpgraph_pie.php");
include ("../jpgraph_pie3d.php");

// vstupni data
$data = array(16,8,6,66,4);

// vytvoreni kolace, jeho velikost a stin
$graph = new PieGraph(350,200);
$graph->SetShadow();

// nastaveni textu a fontu titulku
$graph->title->Set("Sledovanost TV v % úterý 10.5.2002 20:00");
$graph->title->SetFont(FF_FONT1,FS_BOLD);

// parametry kolace, barevne schema, popisky
$p1 = new PiePlot3D($data);
$p1->SetTheme("sand");
$p1->SetLegends(array("NOVA (%d)","ČT1 (%d)","PRIMA (%d)","ČT2 (%d)","Ostatní (%d)"));
$targ=array("?v=NOVA","?v=ČT1","?v=PRIMA","?v=ČT2","?v=ostatni");
$alts=array("NOVA","ČT1","PRIMA","ČT2","Ostatni");
$p1->SetCSIMTargets($targ,$alts);

// pouziti hodnot v procentech
$p1->SetLabelType(1);
$p1->value->SetFormat("%d kr");

// vystrceni konkretniho dilku
$p1->ExplodeSlice(3);

// umisteni kolace do obrazku
$p1->SetCenter(0.4,0.5);

$graph->Add($p1);
// zobrazeni grafu
$graph->Stroke(GenImgName());

// html kod pro zobrazeni obrazku s grafem a klikaci mapy
echo $graph->GetHTMLImageMap("myimagemap");
echo "<img src=\"".GenImgName()."\" ISMAP USEMAP=\"#myimagemap\" border=0>";
?>