如何在pChart中增加饼图大小

时间:2014-02-26 15:31:16

标签: php pchart

方法draw3DPie只允许我定位图形,而不是定义大小。 如果我定义一个更大的图像(pImage),只会增加图表的背景。 我怎样才能得到一个更大的馅饼?

2 个答案:

答案 0 :(得分:2)

$PieChart->draw3DPie(150,100,
                   array("Radius"=>80,
                  "DrawLabels"=>TRUE,"DataGapAngle"=>10,
                  "DataGapRadius"=>6,"Border"=>TRUE));

"Radius"=>80

更改数字以调整大小

归功于stlfan

答案 1 :(得分:0)

首先,您需要调整图像的大小,而不是绘制“填充矩形”,然后修改饼图的半径。

//Change the first 2 values: 1024 and 720:

yPicture = new pImage(1024,720,$MyData);

//Then the 700 and 450 values:

$myPicture->drawFilledRectangle(0,0,700,450,$Settings);

//Then:

$PieChart = new pPie($myPicture,$MyData);


 $PieChart->draw3DPie(350,200,array("Radius"=>140,"DrawLabels"=>TRUE,"LabelStacked"=>TRUE,"Border"=>TRUE));

//Then the 350 and 200 are the position in the screen, the radius is the size of the pie.