-1
下面的代碼使用pChart,可以正常工作,但如果我將系列更改爲小於4的值,我不會收到任何迴應,不斷加載! 若要重現該問題,只需取出系列的最後一個數字: array(9,9,9)爲serie1和array(4,5,6)爲serie3。使用pChart我無法繪製小於4的值的條形圖
<?php
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->AddPoint(array(9,9,9,10),"Serie1");
$DataSet->AddPoint(array(4,5,6,7),"Serie3");
$DataSet->AddAllSeries();
$DataSet->RemoveSerie("Serie3");
$DataSet->SetAbsciseLabelSerie("Serie3");
$DataSet->SetSerieName("January","Serie1");
$DataSet->SetYAxisName("Temperature");
$DataSet->SetYAxisUnit("°C");
$DataSet->SetXAxisUnit("h");
// Initialise the graph
$Test = new pChart(350,230);
$Test->setGraphArea(10,20,240,220);
$Test->drawGraphArea(213,217,221,FALSE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,213,217,221,TRUE,0,2,TRUE);
// Draw the bar chart
$Test->drawBarGraph($DataSet->GetData(),$DataSet->GetDataDescription(),70);
// Render the picture
$Test->Stroke();
?>
我在這裏試過,它工作得很好。你確定沒有其他問題嗎? – Merijn 2011-01-28 10:49:54