require_once ('jpgraph/jpgraph.php'); require_once ('jpgraph/jpgraph_bar.php'); $data = array(19,15,24,27,20,22,22); $graph = new Graph(400,300); $graph->SetScale('textlin'); $graph->img->SetMargin(40,30,20,40); $graph->title->Set('Bar Graph with Shadow'); $graph->title->SetFont(FF_ARIAL,FS_BOLD,14); $bar = new BarPlot($data); $bar->SetShadow(); $graph->Add($bar); $graph->Stroke();
require_once 'phplot.php'; $data = array( array('A', 5), array('B', 8), array('C', 12), array('D', 6), array('E', 8), array('F', 10) ); $plot = new PHPlot(600, 400); $plot->SetTitle('Pie Chart with Shadow'); $plot->SetDataType('text-data'); $plot->SetDataValues($data); $plot->SetPlotType('pie'); $plot->SetPieSliceLinks(True); $plot->SetShading(3); // set shadow to 3 $plot->DrawGraph();This will create a pie chart with a shadow effect using the PHPlot library. In conclusion, the SetShadow function can be used in different PHP graph libraries such as JPGraph or PHPlot to add shadow effects to various types of charts and graphs.