mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 07:44:35 +02:00
Merge branch '1278-extension-vmware-ext-4456-y-4479' into 'develop'
1278 extension vmware ext 4456 y 4479 See merge request artica/pandorafms!1158
This commit is contained in:
commit
f572603882
@ -622,7 +622,7 @@ function hbar_graph($flash_chart, $chart_data, $width, $height,
|
|||||||
$color, $legend, $long_index, $no_data_image, $xaxisname = "",
|
$color, $legend, $long_index, $no_data_image, $xaxisname = "",
|
||||||
$yaxisname = "", $water_mark = "", $font = '', $font_size = '',
|
$yaxisname = "", $water_mark = "", $font = '', $font_size = '',
|
||||||
$unit = '', $ttl = 1, $homeurl = '', $backgroundColor = 'white',
|
$unit = '', $ttl = 1, $homeurl = '', $backgroundColor = 'white',
|
||||||
$tick_color = "white") {
|
$tick_color = "white", $val_min=null, $val_max=null) {
|
||||||
|
|
||||||
setup_watermark($water_mark, $water_mark_file, $water_mark_url);
|
setup_watermark($water_mark, $water_mark_file, $water_mark_url);
|
||||||
|
|
||||||
@ -632,7 +632,7 @@ function hbar_graph($flash_chart, $chart_data, $width, $height,
|
|||||||
|
|
||||||
if ($flash_chart) {
|
if ($flash_chart) {
|
||||||
return flot_hcolumn_chart(
|
return flot_hcolumn_chart(
|
||||||
$chart_data, $width, $height, $water_mark_url, $font, $font_size, $backgroundColor, $tick_color);
|
$chart_data, $width, $height, $water_mark_url, $font, $font_size, $backgroundColor, $tick_color, $val_min, $val_max);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
|
@ -326,8 +326,7 @@ function pandoraFlotPieCustom(graph_id, values, labels, width,
|
|||||||
}
|
}
|
||||||
|
|
||||||
function pandoraFlotHBars(graph_id, values, labels, water_mark,
|
function pandoraFlotHBars(graph_id, values, labels, water_mark,
|
||||||
maxvalue, water_mark, separator, separator2, font, font_size, background_color,
|
maxvalue, water_mark, separator, separator2, font, font_size, background_color, tick_color, min, max) {
|
||||||
tick_color) {
|
|
||||||
|
|
||||||
var colors_data = ['#FC4444','#FFA631','#FAD403','#5BB6E5','#F2919D','#80BA27'];
|
var colors_data = ['#FC4444','#FFA631','#FAD403','#5BB6E5','#F2919D','#80BA27'];
|
||||||
values = values.split(separator2);
|
values = values.split(separator2);
|
||||||
@ -402,7 +401,13 @@ function pandoraFlotHBars(graph_id, values, labels, water_mark,
|
|||||||
// with all 0 values.
|
// with all 0 values.
|
||||||
options['yaxis']['tickDecimals'] = 0;
|
options['yaxis']['tickDecimals'] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (max) {
|
||||||
|
options['xaxis']['max'] = max;
|
||||||
|
}
|
||||||
|
if (min) {
|
||||||
|
options['xaxis']['min'] = min;
|
||||||
|
}
|
||||||
|
|
||||||
var plot = $.plot($('#' + graph_id), datas, options );
|
var plot = $.plot($('#' + graph_id), datas, options );
|
||||||
|
|
||||||
|
@ -674,7 +674,7 @@ function flot_custom_pie_chart ($flash_charts, $graph_values,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Returns a 3D column chart
|
// Returns a 3D column chart
|
||||||
function flot_hcolumn_chart ($graph_data, $width, $height, $water_mark, $font = '', $font_size = 7, $background_color = "white", $tick_color = "white") {
|
function flot_hcolumn_chart ($graph_data, $width, $height, $water_mark, $font = '', $font_size = 7, $background_color = "white", $tick_color = "white", $val_min=null, $val_max=null) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
include_javascript_dependencies_flot_graph();
|
include_javascript_dependencies_flot_graph();
|
||||||
@ -710,7 +710,8 @@ function flot_hcolumn_chart ($graph_data, $width, $height, $water_mark, $font =
|
|||||||
$a = array();
|
$a = array();
|
||||||
$vars = array();
|
$vars = array();
|
||||||
|
|
||||||
$max = 0;
|
$max = PHP_INT_MIN+1;
|
||||||
|
$min = PHP_INT_MAX-1;
|
||||||
$i = count($graph_data);
|
$i = count($graph_data);
|
||||||
$data = array();
|
$data = array();
|
||||||
|
|
||||||
@ -727,9 +728,19 @@ function flot_hcolumn_chart ($graph_data, $width, $height, $water_mark, $font =
|
|||||||
if ($value > $max) {
|
if ($value > $max) {
|
||||||
$max = $value;
|
$max = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($value < $min) {
|
||||||
|
$min = $value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!is_numeric($val_min)) {
|
||||||
|
$val_min = $min;
|
||||||
|
}
|
||||||
|
if (!is_numeric($val_max)) {
|
||||||
|
$val_max = $max;
|
||||||
|
}
|
||||||
|
|
||||||
// Store serialized data to use it from javascript
|
// Store serialized data to use it from javascript
|
||||||
$labels = implode($separator,$labels);
|
$labels = implode($separator,$labels);
|
||||||
@ -755,7 +766,7 @@ function flot_hcolumn_chart ($graph_data, $width, $height, $water_mark, $font =
|
|||||||
$return .= "<script type='text/javascript'>";
|
$return .= "<script type='text/javascript'>";
|
||||||
|
|
||||||
$return .= "pandoraFlotHBars('$graph_id', '$values', '$labels',
|
$return .= "pandoraFlotHBars('$graph_id', '$values', '$labels',
|
||||||
false, $max, '$water_mark', '$separator', '$separator2', '$font', $font_size, '$background_color', '$tick_color')";
|
false, $max, '$water_mark', '$separator', '$separator2', '$font', $font_size, '$background_color', '$tick_color', $val_min, $val_max)";
|
||||||
|
|
||||||
$return .= "</script>";
|
$return .= "</script>";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user