One thing I've been struggling with in pChart is keeping the Y axis within the boundaries of the compass directions. In my case I am attempting to plot wind direction for a weather station, however the resulting charts always come out with a scale of 0-400. This prevents me from adding meaningful customizations such as defining horizontal bars at 0, 90, 180, and 270 degrees.
Some sample code to generate results...
<?php
include("pchart/class/pData.class.php");
include("pchart/class/pDraw.class.php");
include("pchart/class/pImage.class.php");
$points = array(0, 10, 90, 270, 345, 355);
$scale = array(
'Mode' => SCALE_MODE_MANUAL,
'ManualScale' => array(0=>array("Min"=>0,"Max"=>360)),
);
$data = new pData();
$data->addPoints($points, "dir");
$picture = new pImage(256, 128, $data, TRUE);
$picture->setFontProperties(array("FontName" => "pchart/fonts/GeosansLight.ttf","FontSize" =>10));
$picture->setGraphArea(40,10,216,108);
$picture->drawScale($scale);
$picture->drawPlotChart(array("PlotSize"=>1,"PlotBorder"=>TRUE,"BorderSize"=>1));
$picture->Render("wind.png");
echo "<img src='wind.png'>";
And the resulting chart... Wind direction chart results
As you can see, the Y axis does not honor the requested ManualScale settings despite the data points being well within the boundaries. I have tried use a Max of 359 and 360 (with 360 being the more correct choice since decimal values may be entered). I have also tried specifying scale MinDivHeight (divided by 5 to get the four compass directions) and/or Factors (testing with multiples of 90), but values are always overwritten in favor of a chart that spans 0-400. On the other hand, using a scale of 0-100 for percentage data works exactly as expected.
Am I missing something, or is this just a limitation of pChart that makes it impossible to perform this simple task?