简介:
include "../libchart/classes/libchart.php";
$chart = new HorizontalBarChart(600, 170);
$dataSet = new XYDataSet();
$dataSet->addPoint(new Point("/wiki/Instant_messenger", 50));
$dataSet->addPoint(new Point("/wiki/Web_Browser", 75));
$dataSet->addPoint(new Point("/wiki/World_Wide_Web", 122));
$chart->setDataSet($dataSet);
$chart->getPlot()->setGraphPadding(new Padding(5, 30, 20, 140));
$chart->setTitle("Most visited pages for www.example.com");
$chart->render("generated/demo2.png");
//画一个3维饼图专用函数
//$data,饼图结构数据
//$data数据参数
//$XPos,圆心的X坐标
//$YPos,圆心的Y坐标
//$Radius=100,半径
//$DrawLabels=PIE_NOLABEL,标签样式(百分比和标签)
//$EnhanceColors=false, 边框渲染
//$Skew=50,倾斜角度
//$SpliceHeight=20,饼的厚度
//$SpliceDistance=5,各板块间距离
//$Decimals=2 显示百分比小数位数