MINI
C:
/
SiakApp2.2
/
lib
/
Upload File:
files >> C:/SiakApp2.2/lib/SiakCapilChart.php
<?php require_once 'chart/phplot.php'; function CapilBarChart($data, $legend, $title, $width="960", $height="600") { $plot = new PHPlot($width, $height); $plot->SetDefaultTTFont(dirname(__FILE__).'/chart/arial.ttf'); //$plot->SetImageBorderType('raised'); //$plot->SetImageBorderColor('white'); $plot->SetPlotType('bars'); $plot->SetDataType('text-data'); $plot->SetDataValues($data); $plot->SetTitle($title); $plot->SetLegend($legend); $plot->SetXLabelAngle(65); $plot->SetXTickLabelPos('none'); $plot->SetXTickPos('none'); $plot->DrawGraph(); } function CapilPieChart($data, $title, $width="800", $height="600") { $plot = new PHPlot($width, $height); $plot->SetDefaultTTFont(dirname(__FILE__).'/chart/arial.ttf'); //$plot->SetImageBorderType('raised'); //$plot->SetImageBorderColor('white'); $plot->SetPlotType('pie'); $plot->SetDataType('text-data-single'); $plot->SetDataValues($data); # Set enough different colors; $plot->SetDataColors(array('red', 'green', 'blue', 'yellow', 'cyan', 'magenta', 'brown', 'lavender', 'pink', 'gray', 'orange')); # Main plot title: $plot->SetTitle($title); # Build a legend from our data array. # Each call to SetLegend makes one line as "label: value". foreach ($data as $row) $plot->SetLegend(implode(': ', $row)); $plot->DrawGraph(); }
Copyright ©2021 || Defacer Indonesia