Hi,
I've noticed an error in the pchart class description: the method getLegendBox doesn't exist, the right's method's name is getLegendBoxSize.
Your example is:
// Retrieve the width and height of the legend box
$BoxSize = $MyPicture->getLegendBox($DataSet->GetDataDescription());
// Print the legend box always aligned in the top right corner with a padding of 10px
// assuming your pChart graph width is 600px
$Test->drawLegend(590-$BoxSize[0],10,$DataSet->GetDataDescription(),255,255,255);
It should be (you didn't use $MyPicture as pchart object but $Test):
// Retrieve the width and height of the legend box
$BoxSize = $MyPicture->getLegendBoxSize($DataSet->GetDataDescription());
// Print the legend box always aligned in the top right corner with a padding of 10px
// assuming your pChart graph width is 600px
$BoxSize ->drawLegend(590-$BoxSize[0],10,$DataSet->GetDataDescription(),255,255,255);