2013-06-20 Miguel de Dios <miguel.dedios@artica.es>

* include/graphs/functions_pchart.php: fixed the graphs with all
	values in negative Y axis. Now it shows correct.
	
	Fixes: #2302
	
	MERGED FROM THE BRANCH PANDORA_4.0




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8367 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-06-20 12:59:22 +00:00
parent 5a612bcfbe
commit b5904ecbcc
2 changed files with 17 additions and 1 deletions

View File

@ -1,3 +1,12 @@
2013-06-20 Miguel de Dios <miguel.dedios@artica.es>
* include/graphs/functions_pchart.php: fixed the graphs with all
values in negative Y axis. Now it shows correct.
Fixes: #2302
MERGED FROM THE BRANCH PANDORA_4.0
2013-06-20 Miguel de Dios <miguel.dedios@artica.es>
* include/graphs/fgraph.php, include/graphs/functions_pchart.php:

View File

@ -789,18 +789,25 @@ function pch_vertical_graph ($graph_type, $index, $data, $width, $height,
/*Get minimun value to draw axis properly*/
$min_data = min(min($data));
$ManualScale = array();
$mode = SCALE_MODE_START0;
if ($min_data < 0) {
$mode = SCALE_MODE_FLOATING;
}
if ($max_data < 0) {
$ManualScale = array(0 => array("Min" => $min_data, "Max" => 0));
$mode = SCALE_MODE_MANUAL;
}
/* Draw the scale */
$scaleSettings = array("GridR"=>200,
"GridG"=>200,
"GridB"=>200,
"DrawSubTicks"=>TRUE,
"CycleBackground"=>TRUE,
"Mode" => $mode,
"Mode" => $mode,
"ManualScale" => $ManualScale,
"LabelRotation" => 40,
"XMargin" => 0,
"MinDivHeight" => 20,