pChart 2.x forum
http://wiki.pchart.net/forum/

drawPieLegend Alignment
http://wiki.pchart.net/forum/viewtopic.php?f=5&t=2192
Page 1 of 1

Author:  hstorn [ Sun Oct 02, 2011 3:22 pm ]
Post subject:  drawPieLegend Alignment

Hello,

When I want to create a pie chart, the legend of the second element is shifted by one pixel from the first.

Code:
<?php

require dirname(__FILE__).'/class/pChart/pData.class.php';
require dirname(__FILE__).'/class/pChart/pDraw.class.php';
require dirname(__FILE__).'/class/pChart/pPie.class.php';
require dirname(__FILE__).'/class/pChart/pImage.class.php';

$pData = new pData();
$pData->addPoints(array(60, 40));
$pData->setSerieDescription("Status");

$pData->addPoints(array("FirstElement", "SecondElement"), "Labels");
$pData->setAbscissa("Labels");

$Picture = new pImage(210, 150, $pData);
$Picture->setFontProperties(array("FontName" => "./fonts/verdana.ttf", "FontSize" => 8, "R" => 51 , "G" => 51, "B" => 51));

$PieChart = new pPie($Picture, $pData);
$PieChart->setSliceColor(0, array("R" => 0, "G" => 204, "B" => 51));
$PieChart->setSliceColor(1, array("R" => 255, "G" => 51, "B" => 0));
$PieChart->draw3DPie(105, 70, array("WriteValues" => TRUE, "Border" => TRUE));

$PieChart->drawPieLegend(35, 130, array("Style" => LEGEND_NOBORDER, "Mode" => LEGEND_HORIZONTAL));
$Picture->autoOutput("status.png");

?>


I've made perhaps ​​a mistake ?

Thank you for this excellent library.

Regards.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/