2012-02-07 Dario Rodriguez <dario.rodriguez@artica.es>
* include/graphs/functions_pchart.php: Fixed a problem charting lineal and area graph with negative values in static mode. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5505 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
e80b4f0c92
commit
c43cafdf67
|
@ -1,3 +1,8 @@
|
|||
2012-02-07 Dario Rodriguez <dario.rodriguez@artica.es>
|
||||
|
||||
* include/graphs/functions_pchart.php: Fixed a problem charting lineal
|
||||
and area graph with negative values in static mode.
|
||||
|
||||
2012-02-07 Dario Rodriguez <dario.rodriguez@artica.es>
|
||||
|
||||
* pandoradb.sql,
|
||||
|
|
|
@ -719,13 +719,21 @@ function pch_vertical_graph ($graph_type, $index, $data, $width, $height,
|
|||
/* Define the chart area */
|
||||
$myPicture->setGraphArea($chart_size, 5,$width - $water_mark_width,$height - $margin_bottom);
|
||||
}
|
||||
|
||||
/*Get minimun value to draw axis properly*/
|
||||
$min_data = min(min($data));
|
||||
|
||||
$mode = SCALE_MODE_START0;
|
||||
if ($min_data < 0) {
|
||||
$mode = SCALE_MODE_FLOATING;
|
||||
}
|
||||
|
||||
/* Draw the scale */
|
||||
$scaleSettings = array("GridR"=>200,
|
||||
"GridG"=>200,
|
||||
"GridB"=>200,
|
||||
"DrawSubTicks"=>TRUE,
|
||||
"CycleBackground"=>TRUE, "Mode"=>SCALE_MODE_START0, "LabelRotation" => 60, "XMargin" => 0, "MinDivHeight" => 20);
|
||||
"CycleBackground"=>TRUE, "Mode" => $mode, "LabelRotation" => 60, "XMargin" => 0, "MinDivHeight" => 20);
|
||||
$myPicture->drawScale($scaleSettings);
|
||||
|
||||
/* Turn on shadow computing */
|
||||
|
@ -748,7 +756,7 @@ function pch_vertical_graph ($graph_type, $index, $data, $width, $height,
|
|||
"DisplayZeroValues"=>FALSE,
|
||||
"DisplayR"=>100,
|
||||
"DisplayZeros"=> FALSE,
|
||||
"DisplayG"=>100,"DisplayB"=>100,"DisplayShadow"=>TRUE,"Surrounding"=>5,"AroundZero"=>FALSE);
|
||||
"DisplayG"=>100,"DisplayB"=>100,"DisplayShadow"=>TRUE,"Surrounding"=>5,"AroundZero"=>TRUE);
|
||||
|
||||
|
||||
switch($graph_type) {
|
||||
|
|
Loading…
Reference in New Issue