mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 00:04:37 +02:00
2012-03-08 Sergio Martin <sergio.martin@artica.es>
* include/functions_graph.php include/graphs/functions_flot.php include/graphs/flot/pandora.flot.js include/graphs/fgraph.php operation/agentes/stat_win.php: Adapted events slice graph to the sparse/boolean/string graph. Fix some bugs on menu and legend graphs git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5721 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
971687744e
commit
4fa4605ca0
@ -1,3 +1,13 @@
|
|||||||
|
2012-03-08 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
|
* include/functions_graph.php
|
||||||
|
include/graphs/functions_flot.php
|
||||||
|
include/graphs/flot/pandora.flot.js
|
||||||
|
include/graphs/fgraph.php
|
||||||
|
operation/agentes/stat_win.php: Adapted events slice graph to
|
||||||
|
the sparse/boolean/string graph. Fix some bugs on menu and legend
|
||||||
|
graphs
|
||||||
|
|
||||||
2012-03-07 Miguel de Dios <miguel.dedios@artica.es>
|
2012-03-07 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
* godmode/alerts/alert_list.builder.php,
|
* godmode/alerts/alert_list.builder.php,
|
||||||
|
@ -29,7 +29,7 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
|
|||||||
$width, $height , $title = '', $unit_name = null,
|
$width, $height , $title = '', $unit_name = null,
|
||||||
$show_alerts = false, $avg_only = 0, $pure = false,
|
$show_alerts = false, $avg_only = 0, $pure = false,
|
||||||
$date = 0, $unit = '', $baseline = 0, $return_data = 0, $show_title = true,
|
$date = 0, $unit = '', $baseline = 0, $return_data = 0, $show_title = true,
|
||||||
$only_image = false, $homeurl = '', $ttl = 1, $projection = false) {
|
$only_image = false, $homeurl = '', $ttl = 1, $projection = false, $adapt_key = '') {
|
||||||
|
|
||||||
global $config;
|
global $config;
|
||||||
global $graphic_type;
|
global $graphic_type;
|
||||||
@ -388,7 +388,7 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
|
|||||||
$long_index, "images/image_problem.opaque.png", "", "", $homeurl,
|
$long_index, "images/image_problem.opaque.png", "", "", $homeurl,
|
||||||
$water_mark,
|
$water_mark,
|
||||||
$config['fontpath'], $config['font_size'], $unit, $ttl, $series_type,
|
$config['fontpath'], $config['font_size'], $unit, $ttl, $series_type,
|
||||||
$chart_extra_data, $warning_min, $critical_min);
|
$chart_extra_data, $warning_min, $critical_min, $adapt_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
function graph_get_formatted_date($timestamp, $format1, $format2) {
|
function graph_get_formatted_date($timestamp, $format1, $format2) {
|
||||||
@ -1729,7 +1729,7 @@ function fs_error_image () {
|
|||||||
|
|
||||||
function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
|
function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
|
||||||
$width, $height , $title, $unit_name, $show_alerts, $avg_only = 0, $pure=0,
|
$width, $height , $title, $unit_name, $show_alerts, $avg_only = 0, $pure=0,
|
||||||
$date = 0, $only_image = false, $homeurl = '') {
|
$date = 0, $only_image = false, $homeurl = '', $adapt_key) {
|
||||||
global $config;
|
global $config;
|
||||||
global $graphic_type;
|
global $graphic_type;
|
||||||
|
|
||||||
@ -2028,7 +2028,8 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
|
|||||||
return area_graph($flash_chart, $chart, $width, $height, $color, $legend,
|
return area_graph($flash_chart, $chart, $width, $height, $color, $legend,
|
||||||
$long_index, "images/image_problem.opaque.png", "", $unit, $homeurl,
|
$long_index, "images/image_problem.opaque.png", "", $unit, $homeurl,
|
||||||
$water_mark,
|
$water_mark,
|
||||||
$config['fontpath'], $config['font_size'], $unit);
|
$config['fontpath'], $config['font_size'], $unit, 1, array(),
|
||||||
|
array(), 0, 0, $adapt_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2206,7 +2207,7 @@ function graph_netflow_aggregate_pie ($data, $aggregate) {
|
|||||||
*/
|
*/
|
||||||
function grafico_modulo_string ($agent_module_id, $period, $show_events,
|
function grafico_modulo_string ($agent_module_id, $period, $show_events,
|
||||||
$width, $height , $title, $unit_name, $show_alerts, $avg_only = 0, $pure=0,
|
$width, $height , $title, $unit_name, $show_alerts, $avg_only = 0, $pure=0,
|
||||||
$date = 0, $only_image = false, $homeurl = '') {
|
$date = 0, $only_image = false, $homeurl = '', $adapt_key) {
|
||||||
global $config;
|
global $config;
|
||||||
global $graphic_type;
|
global $graphic_type;
|
||||||
|
|
||||||
@ -2415,7 +2416,7 @@ function grafico_modulo_string ($agent_module_id, $period, $show_events,
|
|||||||
return vbar_graph($flash_chart, $chart, $width, $height, $color,
|
return vbar_graph($flash_chart, $chart, $width, $height, $color,
|
||||||
$legend, "", $unit, $homeurl,
|
$legend, "", $unit, $homeurl,
|
||||||
$water_mark,
|
$water_mark,
|
||||||
$config['fontpath'], $config['font_size'], true, true, 1, true);
|
$config['fontpath'], $config['font_size'], true, 1, true, $adapt_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
function grafico_modulo_log4x ($id_agente_modulo, $periodo, $show_event,
|
function grafico_modulo_log4x ($id_agente_modulo, $periodo, $show_event,
|
||||||
@ -2793,8 +2794,9 @@ function grafico_modulo_log4x_format_y_axis ( $number , $decimals=2, $dec_point=
|
|||||||
* @param integer period time period
|
* @param integer period time period
|
||||||
* @param string homeurl Home url if the complete path is needed
|
* @param string homeurl Home url if the complete path is needed
|
||||||
* @param int Zoom factor over the graph
|
* @param int Zoom factor over the graph
|
||||||
|
* @param string adaptation width and margin left key (could be adapter_[something] or adapted_[something])
|
||||||
*/
|
*/
|
||||||
function graphic_module_events ($id_module, $width, $height, $period = 0, $homeurl = '', $zoom = 0) {
|
function graphic_module_events ($id_module, $width, $height, $period = 0, $homeurl = '', $zoom = 0, $adapt_key = '') {
|
||||||
global $config;
|
global $config;
|
||||||
global $graphic_type;
|
global $graphic_type;
|
||||||
|
|
||||||
@ -2882,7 +2884,7 @@ function graphic_module_events ($id_module, $width, $height, $period = 0, $homeu
|
|||||||
|
|
||||||
// Draw slicebar graph
|
// Draw slicebar graph
|
||||||
if($config['flash_charts']) {
|
if($config['flash_charts']) {
|
||||||
echo flot_slicesbar_graph($data, $period, $width, 15, $legend, $colors, $config['fontpath'], $config['round_corner'], $homeurl);
|
echo flot_slicesbar_graph($data, $period, $width, 15, $legend, $colors, $config['fontpath'], $config['round_corner'], $homeurl, '', $adapt_key);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo slicesbar_graph($data, $period, $width, 15, $colors, $config['fontpath'], $config['round_corner'], $homeurl);
|
echo slicesbar_graph($data, $period, $width, 15, $colors, $config['fontpath'], $config['round_corner'], $homeurl);
|
||||||
|
@ -182,12 +182,13 @@ function slicesbar_graph($chart_data, $period, $width, $height, $colors, $font,
|
|||||||
|
|
||||||
function vbar_graph($flash_chart, $chart_data, $width, $height, $color = array(),
|
function vbar_graph($flash_chart, $chart_data, $width, $height, $color = array(),
|
||||||
$legend = array(), $xaxisname = "", $yaxisname = "", $homedir="",
|
$legend = array(), $xaxisname = "", $yaxisname = "", $homedir="",
|
||||||
$water_mark = '', $font = '', $font_size = '', $force_steps = true, $ttl = 1, $reduce_data_columns = false) {
|
$water_mark = '', $font = '', $font_size = '', $force_steps = true, $ttl = 1, $reduce_data_columns = false,
|
||||||
|
$adapt_key) {
|
||||||
|
|
||||||
setup_watermark($water_mark, $water_mark_file, $water_mark_url);
|
setup_watermark($water_mark, $water_mark_file, $water_mark_url);
|
||||||
|
|
||||||
if($flash_chart) {
|
if($flash_chart) {
|
||||||
return flot_vcolumn_chart ($chart_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, $water_mark_url, $homedir, $reduce_data_columns);
|
return flot_vcolumn_chart ($chart_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, $water_mark_url, $homedir, $reduce_data_columns, $adapt_key);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$graph = array();
|
$graph = array();
|
||||||
@ -209,6 +210,7 @@ function vbar_graph($flash_chart, $chart_data, $width, $height, $color = array()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NOT USED ACTUALLY
|
||||||
function threshold_graph($flash_chart, $chart_data, $width, $height, $ttl = 1) {
|
function threshold_graph($flash_chart, $chart_data, $width, $height, $ttl = 1) {
|
||||||
if($flash_chart) {
|
if($flash_chart) {
|
||||||
return flot_area_simple_graph($chart_data, $width, $height);
|
return flot_area_simple_graph($chart_data, $width, $height);
|
||||||
@ -221,7 +223,7 @@ function threshold_graph($flash_chart, $chart_data, $width, $height, $ttl = 1) {
|
|||||||
function area_graph($flash_chart, $chart_data, $width, $height, $color, $legend,
|
function area_graph($flash_chart, $chart_data, $width, $height, $color, $legend,
|
||||||
$long_index, $no_data_image, $xaxisname = "", $yaxisname = "", $homeurl="",
|
$long_index, $no_data_image, $xaxisname = "", $yaxisname = "", $homeurl="",
|
||||||
$water_mark = "", $font = '', $font_size = '', $unit = '', $ttl = 1, $series_type = array(),
|
$water_mark = "", $font = '', $font_size = '', $unit = '', $ttl = 1, $series_type = array(),
|
||||||
$chart_extra_data = array(), $yellow_threshold = 0, $red_threshold = 0) {
|
$chart_extra_data = array(), $yellow_threshold = 0, $red_threshold = 0, $adapt_key = '') {
|
||||||
|
|
||||||
setup_watermark($water_mark, $water_mark_file, $water_mark_url);
|
setup_watermark($water_mark, $water_mark_file, $water_mark_url);
|
||||||
|
|
||||||
@ -235,7 +237,7 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color, $legend,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($flash_chart) {
|
if($flash_chart) {
|
||||||
return flot_area_simple_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, $water_mark_url, $series_type, $chart_extra_data, $yellow_threshold, $red_threshold);
|
return flot_area_simple_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, $water_mark_url, $series_type, $chart_extra_data, $yellow_threshold, $red_threshold, $adapt_key);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$graph = array();
|
$graph = array();
|
||||||
|
@ -241,7 +241,7 @@ function pandoraFlotVBars(graph_id, values, labels, labels_long, legend, colors,
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
labels = labels.split(separator).reverse();
|
labels = labels.split(separator);
|
||||||
|
|
||||||
var stack = 0, bars = true, lines = false, steps = false;
|
var stack = 0, bars = true, lines = false, steps = false;
|
||||||
|
|
||||||
@ -356,6 +356,9 @@ function pandoraFlotSlicebar(graph_id, values, datacolor, labels, legend, acumul
|
|||||||
acumulate_data = acumulate_data.split(separator);
|
acumulate_data = acumulate_data.split(separator);
|
||||||
datacolor = datacolor.split(separator);
|
datacolor = datacolor.split(separator);
|
||||||
|
|
||||||
|
// Check possible adapt_keys on classes
|
||||||
|
check_adaptions(graph_id);
|
||||||
|
|
||||||
var datas = new Array();
|
var datas = new Array();
|
||||||
|
|
||||||
for(i=0;i<values.length;i++) {
|
for(i=0;i<values.length;i++) {
|
||||||
@ -402,6 +405,33 @@ function pandoraFlotSlicebar(graph_id, values, datacolor, labels, legend, acumul
|
|||||||
|
|
||||||
var plot = $.plot($('#'+graph_id), datas, options );
|
var plot = $.plot($('#'+graph_id), datas, options );
|
||||||
|
|
||||||
|
// Events
|
||||||
|
$('#'+graph_id).bind('plothover', function (event, pos, item) {
|
||||||
|
if(item) {
|
||||||
|
var from = legend[item.seriesIndex];
|
||||||
|
var to = legend[item.seriesIndex+1];
|
||||||
|
|
||||||
|
if(to == undefined) {
|
||||||
|
to = '>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#extra_'+graph_id).text(from+'-'+to);
|
||||||
|
var extra_height = parseInt($('#extra_'+graph_id).css('height').split('px')[0]);
|
||||||
|
var extra_width = parseInt($('#extra_'+graph_id).css('width').split('px')[0]);
|
||||||
|
$('#extra_'+graph_id).css('left',pos.pageX-(extra_width/2)+'px');
|
||||||
|
$('#extra_'+graph_id).css('top',plot.offset().top-extra_height-5+'px');
|
||||||
|
|
||||||
|
$('#extra_'+graph_id).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#'+graph_id).bind('mouseout',resetInteractivity);
|
||||||
|
|
||||||
|
// Reset interactivity styles
|
||||||
|
function resetInteractivity() {
|
||||||
|
$('#extra_'+graph_id).hide();
|
||||||
|
}
|
||||||
|
|
||||||
// Format functions
|
// Format functions
|
||||||
function xFormatter(v, axis) {
|
function xFormatter(v, axis) {
|
||||||
for(i = 0; i < acumulate_data.length; i++) {
|
for(i = 0; i < acumulate_data.length; i++) {
|
||||||
@ -606,14 +636,9 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, colors,
|
|||||||
var plot = $.plot($('#'+graph_id), datas, options);
|
var plot = $.plot($('#'+graph_id), datas, options);
|
||||||
|
|
||||||
// Adjust the overview plot to the width and position of the main plot
|
// Adjust the overview plot to the width and position of the main plot
|
||||||
yAxisWidth = $('#'+graph_id+' .yAxis .tickLabel').css('width');
|
adjust_left_width_canvas(graph_id, 'overview_'+graph_id);
|
||||||
|
|
||||||
overview_pix = $('#overview_'+graph_id).css('width').split('px');
|
// Adjust linked graph to the width and position of the main plot
|
||||||
new_overview_width = parseInt(overview_pix[0])-parseInt(yAxisWidth);
|
|
||||||
|
|
||||||
$('#overview_'+graph_id).css('width',new_overview_width);
|
|
||||||
|
|
||||||
$('#overview_'+graph_id).css('margin-left',yAxisWidth);
|
|
||||||
|
|
||||||
// Miniplot
|
// Miniplot
|
||||||
var overview = $.plot($('#overview_'+graph_id),datas, {
|
var overview = $.plot($('#overview_'+graph_id),datas, {
|
||||||
@ -906,6 +931,10 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, colors,
|
|||||||
|
|
||||||
// Adjust the menu image on top of the plot
|
// Adjust the menu image on top of the plot
|
||||||
$('#menu_overview_'+graph_id)[0].onload = function() {
|
$('#menu_overview_'+graph_id)[0].onload = function() {
|
||||||
|
// If there is no legend we increase top-padding to make space to the menu
|
||||||
|
if(legends.length == 0) {
|
||||||
|
$('#menu_'+graph_id).parent().css('padding-top',$('#menu_'+graph_id).css('height'));
|
||||||
|
}
|
||||||
// Add bottom margin in the legend
|
// Add bottom margin in the legend
|
||||||
var menu_height = parseInt($('#menu_'+graph_id).css('height').split('px')[0]);
|
var menu_height = parseInt($('#menu_'+graph_id).css('height').split('px')[0]);
|
||||||
var legend_margin_bottom = parseInt($('#legend_'+graph_id).css('margin-bottom').split('px')[0]);
|
var legend_margin_bottom = parseInt($('#legend_'+graph_id).css('margin-bottom').split('px')[0]);
|
||||||
@ -987,3 +1016,26 @@ function get_event_details (event_ids) {
|
|||||||
|
|
||||||
return table;
|
return table;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function adjust_left_width_canvas(adapter_id, adapted_id) {
|
||||||
|
adapter_left_margin = $('#'+adapter_id+' .yAxis .tickLabel').css('width');
|
||||||
|
|
||||||
|
adapted_pix = $('#'+adapted_id).css('width').split('px');
|
||||||
|
new_adapted_width = parseInt(adapted_pix[0])-parseInt(adapter_left_margin);
|
||||||
|
|
||||||
|
$('#'+adapted_id).css('width',new_adapted_width);
|
||||||
|
|
||||||
|
$('#'+adapted_id).css('margin-left',adapter_left_margin);
|
||||||
|
}
|
||||||
|
|
||||||
|
function check_adaptions(graph_id) {
|
||||||
|
var classes = $('#'+graph_id).attr('class').split(' ');
|
||||||
|
|
||||||
|
$.each(classes, function(i,v) {
|
||||||
|
// If has a class starting with adapted, we adapt it
|
||||||
|
if(v.split('_')[0] == 'adapted') {
|
||||||
|
var adapter_id = $('.adapter_'+v.split('_')[1]).attr('id');
|
||||||
|
adjust_left_width_canvas(adapter_id, graph_id);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@ -77,39 +77,31 @@ function include_javascript_dependencies_flot_graph($return = false) {
|
|||||||
///////////////////////////////
|
///////////////////////////////
|
||||||
////////// AREA GRAPHS ////////
|
////////// AREA GRAPHS ////////
|
||||||
///////////////////////////////
|
///////////////////////////////
|
||||||
function flot_area_stacked_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl = '', $unit = '', $water_mark = '', $serie_types = array(), $chart_extra_data = array(), $yellow_threshold = '', $red_threshold = '') {
|
function flot_area_stacked_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl = '', $unit = '', $water_mark = '', $serie_types = array(), $chart_extra_data = array(), $yellow_threshold = 0, $red_threshold = 0, $adapt_key= '') {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
include_javascript_dependencies_flot_graph();
|
return flot_area_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, 'area_stacked', $water_mark, $serie_types, $chart_extra_data, $yellow_threshold, $red_threshold, $adapt_key);
|
||||||
|
|
||||||
return flot_area_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, 'area_stacked', $water_mark, $serie_types, $chart_extra_data, $yellow_threshold, $red_threshold);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function flot_area_simple_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl = '', $unit = '', $water_mark = '', $serie_types = array(), $chart_extra_data = array(), $yellow_threshold = '', $red_threshold = '') {
|
function flot_area_simple_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl = '', $unit = '', $water_mark = '', $serie_types = array(), $chart_extra_data = array(), $yellow_threshold = 0, $red_threshold = 0, $adapt_key= '') {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
include_javascript_dependencies_flot_graph();
|
return flot_area_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, 'area_simple', $water_mark, $serie_types, $chart_extra_data, $yellow_threshold, $red_threshold, $adapt_key);
|
||||||
|
|
||||||
return flot_area_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, 'area_simple', $water_mark, $serie_types, $chart_extra_data, $yellow_threshold, $red_threshold);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function flot_line_stacked_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl = '', $unit = '', $water_mark = '', $serie_types = array(), $chart_extra_data = array(), $yellow_threshold = '', $red_threshold = '') {
|
function flot_line_stacked_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl = '', $unit = '', $water_mark = '', $serie_types = array(), $chart_extra_data = array(), $yellow_threshold = 0, $red_threshold = 0, $adapt_key= '') {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
include_javascript_dependencies_flot_graph();
|
return flot_area_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, 'line_stacked', $water_mark, $serie_types, $chart_extra_data, $yellow_threshold, $red_threshold, $adapt_key);
|
||||||
|
|
||||||
return flot_area_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, 'line_stacked', $water_mark, $serie_types, $chart_extra_data, $yellow_threshold, $red_threshold);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function flot_line_simple_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl = '', $unit = '', $water_mark = '', $serie_types = array(), $chart_extra_data = array(), $yellow_threshold = '', $red_threshold = '') {
|
function flot_line_simple_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl = '', $unit = '', $water_mark = '', $serie_types = array(), $chart_extra_data = array(), $yellow_threshold = 0, $red_threshold = 0, $adapt_key= '') {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
include_javascript_dependencies_flot_graph();
|
return flot_area_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, 'line_simple', $water_mark, $serie_types, $chart_extra_data, $yellow_threshold, $red_threshold, $adapt_key);
|
||||||
|
|
||||||
return flot_area_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, 'line_simple', $water_mark, $serie_types, $chart_extra_data, $yellow_threshold, $red_threshold);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function flot_area_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, $type, $water_mark, $serie_types, $chart_extra_data, $yellow_threshold, $red_threshold) {
|
function flot_area_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, $type, $water_mark, $serie_types, $chart_extra_data, $yellow_threshold, $red_threshold, $adapt_key) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
include_javascript_dependencies_flot_graph();
|
include_javascript_dependencies_flot_graph();
|
||||||
@ -124,7 +116,7 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend, $long_in
|
|||||||
$return = "<div>";
|
$return = "<div>";
|
||||||
// Set some containers to legend, graph, timestamp tooltip, etc.
|
// Set some containers to legend, graph, timestamp tooltip, etc.
|
||||||
$return .= "<p id='legend_$graph_id' style='font-size:".$font_size."pt'></p>";
|
$return .= "<p id='legend_$graph_id' style='font-size:".$font_size."pt'></p>";
|
||||||
$return .= "<div id='$graph_id' class='graph' style='width: ".$width."px; height: ".$height."px;'></div>";
|
$return .= "<div id='$graph_id' class='graph $adapt_key' style='width: ".$width."px; height: ".$height."px;'></div>";
|
||||||
$return .= "<div id='overview_$graph_id' style='display:none; margin-left:0px; margin-top:20px; width: ".$width."px; height:50px;'></div>";
|
$return .= "<div id='overview_$graph_id' style='display:none; margin-left:0px; margin-top:20px; width: ".$width."px; height:50px;'></div>";
|
||||||
$return .= "<div id='timestamp_$graph_id' style='font-size:".$font_size."pt;display:none; position:absolute; background:#fff; border: solid 1px #aaa; padding: 2px'></div>";
|
$return .= "<div id='timestamp_$graph_id' style='font-size:".$font_size."pt;display:none; position:absolute; background:#fff; border: solid 1px #aaa; padding: 2px'></div>";
|
||||||
|
|
||||||
@ -211,7 +203,7 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend, $long_in
|
|||||||
|
|
||||||
if($menu) {
|
if($menu) {
|
||||||
$threshold = false;
|
$threshold = false;
|
||||||
if($yellow_threshold != '' && $red_threshold != '') {
|
if($yellow_threshold != 0 || $red_threshold != 0) {
|
||||||
$threshold = true;
|
$threshold = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -431,7 +423,7 @@ function flot_hcolumn_chart ($graph_data, $width, $height, $water_mark) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Returns a 3D column chart
|
// Returns a 3D column chart
|
||||||
function flot_vcolumn_chart ($graph_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, $water_mark, $homedir, $reduce_data_columns) {
|
function flot_vcolumn_chart ($graph_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, $water_mark, $homedir, $reduce_data_columns, $adapt_key) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
include_javascript_dependencies_flot_graph();
|
include_javascript_dependencies_flot_graph();
|
||||||
@ -444,7 +436,7 @@ function flot_vcolumn_chart ($graph_data, $width, $height, $color, $legend, $lon
|
|||||||
$graph_id2 = uniqid('graph_');
|
$graph_id2 = uniqid('graph_');
|
||||||
|
|
||||||
// Set some containers to legend, graph, timestamp tooltip, etc.
|
// Set some containers to legend, graph, timestamp tooltip, etc.
|
||||||
$return .= "<div id='$graph_id' class='graph' style='width: ".$width."px; height: ".$height."px;'></div>";
|
$return .= "<div id='$graph_id' class='graph $adapt_key' style='width: ".$width."px; height: ".$height."px;'></div>";
|
||||||
$return .= "<div id='value_$graph_id' style='display:none; position:absolute; background:#fff; border: solid 1px #aaa; padding: 2px'></div>";
|
$return .= "<div id='value_$graph_id' style='display:none; position:absolute; background:#fff; border: solid 1px #aaa; padding: 2px'></div>";
|
||||||
|
|
||||||
if($water_mark != '') {
|
if($water_mark != '') {
|
||||||
@ -536,7 +528,7 @@ function flot_vcolumn_chart ($graph_data, $width, $height, $color, $legend, $lon
|
|||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function flot_slicesbar_graph ($graph_data, $period, $width, $height, $legend, $colors, $fontpath, $round_corner, $homeurl, $watermark = '') {
|
function flot_slicesbar_graph ($graph_data, $period, $width, $height, $legend, $colors, $fontpath, $round_corner, $homeurl, $watermark = '', $adapt_key = '') {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
include_javascript_dependencies_flot_graph();
|
include_javascript_dependencies_flot_graph();
|
||||||
@ -549,7 +541,7 @@ function flot_slicesbar_graph ($graph_data, $period, $width, $height, $legend, $
|
|||||||
$graph_id = uniqid('graph_');
|
$graph_id = uniqid('graph_');
|
||||||
|
|
||||||
// Set some containers to legend, graph, timestamp tooltip, etc.
|
// Set some containers to legend, graph, timestamp tooltip, etc.
|
||||||
$return = "<div id='$graph_id' class='graph' style='width: ".$width."px; height: ".$height."px;'></div>";
|
$return = "<div id='$graph_id' class='graph $adapt_key' style='width: ".$width."px; height: ".$height."px;'></div>";
|
||||||
$return .= "<div id='value_$graph_id' style='display:none; position:absolute; background:#fff; border: solid 1px #aaa; padding: 2px'></div>";
|
$return .= "<div id='value_$graph_id' style='display:none; position:absolute; background:#fff; border: solid 1px #aaa; padding: 2px'></div>";
|
||||||
|
|
||||||
// Set a weird separator to serialize and unserialize passing data from php to javascript
|
// Set a weird separator to serialize and unserialize passing data from php to javascript
|
||||||
@ -578,6 +570,10 @@ function flot_slicesbar_graph ($graph_data, $period, $width, $height, $legend, $
|
|||||||
|
|
||||||
$fontsize = 7;
|
$fontsize = 7;
|
||||||
|
|
||||||
|
$extra_height = 15;
|
||||||
|
|
||||||
|
$return .= "<div id='extra_$graph_id' style='font-size: ".$fontsize."pt; display:none; position:absolute; overflow: auto; height: ".$extra_height."px; background:#fff; padding: 2px 2px 2px 2px; border: solid #000 1px;'></div>";
|
||||||
|
|
||||||
$maxticks = (int) ($width / ($fontsize * $leg_max_length));
|
$maxticks = (int) ($width / ($fontsize * $leg_max_length));
|
||||||
|
|
||||||
$i_aux = $i;
|
$i_aux = $i;
|
||||||
|
@ -167,29 +167,29 @@ echo "<div style='margin-left:20px'>";
|
|||||||
switch ($graph_type) {
|
switch ($graph_type) {
|
||||||
case 'boolean':
|
case 'boolean':
|
||||||
echo grafico_modulo_boolean ($id, $period, $draw_events, $width, $height,
|
echo grafico_modulo_boolean ($id, $period, $draw_events, $width, $height,
|
||||||
$label, null, $draw_alerts, $avg_only, false, $date, false, $urlImage);
|
$label, null, $draw_alerts, $avg_only, false, $date, false, $urlImage, 'adapter_'.$graph_type);
|
||||||
echo '<br><br><br>';
|
echo '<br><br><br>';
|
||||||
if ($show_events_graph)
|
if ($show_events_graph)
|
||||||
echo graphic_module_events($id, $width, $height, $period, $config['homeurl'] . '/', $zoom);
|
echo graphic_module_events($id, $width, $height, $period, $config['homeurl'] . '/', $zoom, 'adapted_'.$graph_type);
|
||||||
break;
|
break;
|
||||||
case 'sparse':
|
case 'sparse':
|
||||||
echo grafico_modulo_sparse ($id, $period, $draw_events, $width, $height,
|
echo grafico_modulo_sparse ($id, $period, $draw_events, $width, $height,
|
||||||
$label, null, $draw_alerts, $avg_only, false, $date, '', $baseline,
|
$label, null, $draw_alerts, $avg_only, false, $date, '', $baseline,
|
||||||
0, true, false, $urlImage);
|
0, true, false, $urlImage, 1, false, 'adapter_'.$graph_type);
|
||||||
echo '<br><br><br>';
|
echo '<br><br><br>';
|
||||||
if ($show_events_graph)
|
if ($show_events_graph)
|
||||||
echo graphic_module_events($id, $width, $height, $period, $config['homeurl'] . '/', $zoom);
|
echo graphic_module_events($id, $width, $height, $period, $config['homeurl'] . '/', $zoom, 'adapted_'.$graph_type);
|
||||||
break;
|
break;
|
||||||
case 'string':
|
case 'string':
|
||||||
echo grafico_modulo_string ($id, $period, $draw_events, $width, $height,
|
echo grafico_modulo_string ($id, $period, $draw_events, $width, $height,
|
||||||
$label, null, $draw_alerts, 1, false, $date, false, $urlImage);
|
$label, null, $draw_alerts, 1, false, $date, false, $urlImage, 'adapter_'.$graph_type);
|
||||||
echo '<br><br><br>';
|
echo '<br><br><br>';
|
||||||
if ($show_events_graph)
|
if ($show_events_graph)
|
||||||
echo graphic_module_events($id, $width, $height, $period, $config['homeurl'] . '/', $zoom);
|
echo graphic_module_events($id, $width, $height, $period, $config['homeurl'] . '/', $zoom, 'adapted_'.$graph_type);
|
||||||
break;
|
break;
|
||||||
case 'log4x':
|
case 'log4x':
|
||||||
echo grafico_modulo_log4x ($id, $period, $draw_events, $width, $height,
|
echo grafico_modulo_log4x ($id, $period, $draw_events, $width, $height,
|
||||||
$label, $unit_name, $draw_alerts, 1, $pure, $date, 1);
|
$label, $unit_name, $draw_alerts, 1, $pure, $date);
|
||||||
echo '<br><br><br>';
|
echo '<br><br><br>';
|
||||||
if ($show_events_graph)
|
if ($show_events_graph)
|
||||||
echo graphic_module_events($id, $width, $height, $period, $config['homeurl'] . '/', $zoom);
|
echo graphic_module_events($id, $width, $height, $period, $config['homeurl'] . '/', $zoom);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user