Modif prcision sur l'axe des Y, reste toujours le problme pour les
nombres entiers
This commit is contained in:
parent
84b2b0b732
commit
ad926f3583
@ -37,6 +37,9 @@ class Graph
|
|||||||
|
|
||||||
$this->precision_y = 0;
|
$this->precision_y = 0;
|
||||||
|
|
||||||
|
$this->width = 400;
|
||||||
|
$this->height = 200;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,19 +48,21 @@ class Graph
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Function draw($file, $data)
|
Function draw($file, $data, $title='')
|
||||||
{
|
{
|
||||||
$w = 400;
|
|
||||||
$h = 200;
|
|
||||||
//Define the object
|
//Define the object
|
||||||
$graph = new PHPlot($w,$h);
|
$graph = new PHPlot($this->width, $this->height);
|
||||||
$graph->SetIsInline(1);
|
$graph->SetIsInline(1);
|
||||||
|
|
||||||
$graph->SetPlotType('bars');
|
$graph->SetPlotType('bars');
|
||||||
|
|
||||||
$graph->SetPlotAreaPixels(60,10,$w-10,$h-30) ;
|
$graph->SetPlotAreaPixels(60, 10, $this->width-10, $this->height - 30) ;
|
||||||
|
|
||||||
$graph->SetBackgroundColor($this->bgcolor);
|
$graph->SetBackgroundColor($this->bgcolor);
|
||||||
$graph->SetPrecisionY($this->precision_Y);
|
|
||||||
|
// TODO
|
||||||
|
//$graph->SetPrecisionY($this->precision_Y);
|
||||||
|
|
||||||
$graph->SetDataColors($this->datacolor, $this->bordercolor);
|
$graph->SetDataColors($this->datacolor, $this->bordercolor);
|
||||||
|
|
||||||
$graph->SetOutputFile($file);
|
$graph->SetOutputFile($file);
|
||||||
@ -67,15 +72,37 @@ class Graph
|
|||||||
|
|
||||||
$graph->SetVertTickIncrement(0);
|
$graph->SetVertTickIncrement(0);
|
||||||
|
|
||||||
|
//
|
||||||
|
if (strlen($title))
|
||||||
|
{
|
||||||
|
$graph->SetTitle = $title;
|
||||||
|
}
|
||||||
|
|
||||||
//Draw it
|
//Draw it
|
||||||
$graph->DrawGraph();
|
$graph->DrawGraph();
|
||||||
}
|
}
|
||||||
|
|
||||||
function SetPrecisionY($which_prec)
|
Function SetPrecisionY($which_prec)
|
||||||
{
|
{
|
||||||
$this->precision_y = $which_prec;
|
$this->precision_y = $which_prec;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Function SetYLabel($label)
|
||||||
|
{
|
||||||
|
$this->YLabel = $label;
|
||||||
|
}
|
||||||
|
|
||||||
|
Function SetWidth($w)
|
||||||
|
{
|
||||||
|
$this->width = $w;
|
||||||
|
}
|
||||||
|
|
||||||
|
Function SetHeight($h)
|
||||||
|
{
|
||||||
|
$this->height = $h;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user