在文件 pDraw.class.php 的 drawBarChart() 方法中,该方法的末尾有以下条件:
if ($DisplayPos == LABEL_POS_INSIDE && abs($TxtWidth) < abs($BarWidth)){
...
else{
在 else 块的末尾是一个 $this->drawText() 方法,它在柱的末尾输出值,并将为系列中的每个柱调用。此时,您还可以使用以下命令将附加值写入图表的末尾(在本例中为右边距):
$itemGap = 45; //the space between items
$items = array(1,2,3); //the value to draw
$colStart = $this->GraphAreaX2 + $itemGap;
foreach($itemGap as $item)
{
$this->drawText($colStart, $Y + $YOffset + $YSize / 2, $item, array("R" => $DisplayR, "G" => $DisplayG, "B" => $DisplayB, "Align" => $Align, "FontSize" => $DisplaySize));
$colStart += $itemGap;
}
我希望这对某人有帮助。