fixed errors in simple graphs value negative
This commit is contained in:
parent
8616015f38
commit
487711d567
|
@ -1667,6 +1667,15 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
|
|||
how_bigger = "K";
|
||||
y = y / 1000;
|
||||
}
|
||||
else if(y < -1000000) {
|
||||
how_bigger = "M";
|
||||
y = y / 1000000;
|
||||
}
|
||||
else if (y < -1000) {
|
||||
console.log('entra por negativo');
|
||||
how_bigger = "K";
|
||||
y = y / 1000;
|
||||
}
|
||||
|
||||
if (currentRanges == null || (currentRanges.xaxis.from < j && j < currentRanges.xaxis.to)) {
|
||||
$('#timestamp_'+graph_id).show();
|
||||
|
@ -2090,6 +2099,10 @@ function number_format(number, force_integer, unit) {
|
|||
pos++; //Position in array starting with 0
|
||||
number = number / 1000;
|
||||
}
|
||||
else if (number <= -1000) {
|
||||
pos++;
|
||||
number = number / 1000;
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -981,7 +981,8 @@ function pch_vertical_graph ($graph_type, $index, $data, $width, $height,
|
|||
($height - $margin_bottom));
|
||||
|
||||
/*Get minimun value to draw axis properly*/
|
||||
$min_data = min($data['min']);
|
||||
|
||||
$min_data = min(min($data));
|
||||
$ManualScale = array();
|
||||
$mode = SCALE_MODE_START0;
|
||||
if ($min_data < 0) {
|
||||
|
@ -992,6 +993,10 @@ function pch_vertical_graph ($graph_type, $index, $data, $width, $height,
|
|||
$ManualScale = array(0 => array("Min" => $min_data, "Max" => 0));
|
||||
$mode = SCALE_MODE_MANUAL;
|
||||
}
|
||||
else if ($max_data >= 0 && $min_data <= 0){
|
||||
$ManualScale = array(0 => array("Min" => $min_data, "Max" => $max_data));
|
||||
$mode = SCALE_MODE_MANUAL;
|
||||
}
|
||||
|
||||
if($graph_threshold){
|
||||
$sql_treshold = 'select min_critical, max_critical, min_warning, max_warning, critical_inverse, warning_inverse from tagente_modulo where id_agente_modulo =' . $id_module;
|
||||
|
|
Loading…
Reference in New Issue