mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Improved the graphs behaviour when rendered into the dashboard or the visual console
This commit is contained in:
parent
dd6fa27402
commit
285d7971e0
@ -1594,7 +1594,6 @@ function graphic_combined_module ($module_list, $weight_list, $period,
|
|||||||
'color' => COL_GRAPH13,
|
'color' => COL_GRAPH13,
|
||||||
'alpha' => CHART_DEFAULT_ALPHA);
|
'alpha' => CHART_DEFAULT_ALPHA);
|
||||||
|
|
||||||
|
|
||||||
switch ($stacked) {
|
switch ($stacked) {
|
||||||
case CUSTOM_GRAPH_AREA:
|
case CUSTOM_GRAPH_AREA:
|
||||||
return area_graph($flash_charts, $graph_values, $width,
|
return area_graph($flash_charts, $graph_values, $width,
|
||||||
|
@ -768,12 +768,14 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$only_image = !$graph_javascript || $isExternalLink;
|
||||||
if ($layoutData['id_custom_graph'] != 0) {
|
if ($layoutData['id_custom_graph'] != 0) {
|
||||||
|
// Show only avg on the visual console
|
||||||
$img = custom_graphs_print(
|
$img = custom_graphs_print(
|
||||||
$layoutData['id_custom_graph'], $height, $width,
|
$layoutData['id_custom_graph'], $height, $width,
|
||||||
$period, null, true, 0, true, $layoutData['image'],
|
$period, null, true, 0, $only_image, $layoutData['image'],
|
||||||
array(), '', array(), array(), true,
|
array(), '', array(), array(), false,
|
||||||
true, true, true, 1, false, $graph_javascript);
|
false, false, true, 1, false, true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ($isExternalLink)
|
if ($isExternalLink)
|
||||||
@ -783,8 +785,8 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||||||
|
|
||||||
$img = grafico_modulo_sparse($id_module, $period, 0, $width,
|
$img = grafico_modulo_sparse($id_module, $period, 0, $width,
|
||||||
$height, '', null, false, 1, false, 0, '', 0, 0,
|
$height, '', null, false, 1, false, 0, '', 0, 0,
|
||||||
true, true, $homeurl, 1, false, '', false, false, true,
|
true, $only_image, $homeurl, 1, false, '', false, false, false,
|
||||||
$layoutData['image'], null, false, $graph_javascript);
|
$layoutData['image'], null, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Restore db connection
|
//Restore db connection
|
||||||
|
@ -239,32 +239,9 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color,
|
|||||||
return '<img src="' . $no_data_image . '" />';
|
return '<img src="' . $no_data_image . '" />';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$menu = (!$dashboard && !$vconsole);
|
||||||
|
|
||||||
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,
|
|
||||||
$adapt_key,
|
|
||||||
$force_integer,
|
|
||||||
$series_suffix_str,
|
|
||||||
$menu,
|
|
||||||
$backgroundColor,
|
|
||||||
$dashboard,
|
|
||||||
false,
|
|
||||||
$agent_module_id);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if ($vconsole) {
|
|
||||||
return flot_area_simple_graph(
|
return flot_area_simple_graph(
|
||||||
$chart_data,
|
$chart_data,
|
||||||
$width,
|
$width,
|
||||||
@ -315,7 +292,6 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color,
|
|||||||
"id_graph=" . $id_graph . "'>";
|
"id_graph=" . $id_graph . "'>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function stacked_area_graph($flash_chart, $chart_data, $width, $height,
|
function stacked_area_graph($flash_chart, $chart_data, $width, $height,
|
||||||
$color, $legend, $long_index, $no_data_image, $xaxisname = "",
|
$color, $legend, $long_index, $no_data_image, $xaxisname = "",
|
||||||
@ -329,6 +305,8 @@ function stacked_area_graph($flash_chart, $chart_data, $width, $height,
|
|||||||
return '<img src="' . $no_data_image . '" />';
|
return '<img src="' . $no_data_image . '" />';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$menu = (!$dashboard && !$vconsole);
|
||||||
|
|
||||||
if ($flash_chart) {
|
if ($flash_chart) {
|
||||||
return flot_area_stacked_graph(
|
return flot_area_stacked_graph(
|
||||||
$chart_data,
|
$chart_data,
|
||||||
@ -347,30 +325,7 @@ function stacked_area_graph($flash_chart, $chart_data, $width, $height,
|
|||||||
'',
|
'',
|
||||||
false,
|
false,
|
||||||
'',
|
'',
|
||||||
true,
|
$menu,
|
||||||
$backgroundColor,
|
|
||||||
$dashboard);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if ($vconsole) {
|
|
||||||
return flot_area_stacked_graph(
|
|
||||||
$chart_data,
|
|
||||||
$width,
|
|
||||||
$height,
|
|
||||||
$color,
|
|
||||||
$legend,
|
|
||||||
$long_index,
|
|
||||||
$homeurl,
|
|
||||||
$unit,
|
|
||||||
$water_mark_url,
|
|
||||||
array(),
|
|
||||||
array(),
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
'',
|
|
||||||
false,
|
|
||||||
'',
|
|
||||||
true,
|
|
||||||
$backgroundColor,
|
$backgroundColor,
|
||||||
$dashboard,
|
$dashboard,
|
||||||
$vconsole,
|
$vconsole,
|
||||||
@ -399,7 +354,6 @@ function stacked_area_graph($flash_chart, $chart_data, $width, $height,
|
|||||||
"include/graphs/functions_pchart.php?static_graph=1&graph_type=stacked_area&ttl=".$ttl."&id_graph=" . $id_graph . "' />";
|
"include/graphs/functions_pchart.php?static_graph=1&graph_type=stacked_area&ttl=".$ttl."&id_graph=" . $id_graph . "' />";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function stacked_line_graph($flash_chart, $chart_data, $width, $height,
|
function stacked_line_graph($flash_chart, $chart_data, $width, $height,
|
||||||
$color, $legend, $long_index, $no_data_image, $xaxisname = "",
|
$color, $legend, $long_index, $no_data_image, $xaxisname = "",
|
||||||
@ -413,6 +367,7 @@ function stacked_line_graph($flash_chart, $chart_data, $width, $height,
|
|||||||
return '<img src="' . $no_data_image . '" />';
|
return '<img src="' . $no_data_image . '" />';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$menu = (!$dashboard && !$vconsole);
|
||||||
|
|
||||||
if ($flash_chart) {
|
if ($flash_chart) {
|
||||||
return flot_line_stacked_graph(
|
return flot_line_stacked_graph(
|
||||||
@ -432,30 +387,7 @@ function stacked_line_graph($flash_chart, $chart_data, $width, $height,
|
|||||||
'',
|
'',
|
||||||
false,
|
false,
|
||||||
'',
|
'',
|
||||||
true,
|
$menu,
|
||||||
$background_color,
|
|
||||||
$dashboard);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if ($vconsole) {
|
|
||||||
return flot_line_stacked_graph(
|
|
||||||
$chart_data,
|
|
||||||
$width,
|
|
||||||
$height,
|
|
||||||
$color,
|
|
||||||
$legend,
|
|
||||||
$long_index,
|
|
||||||
$homeurl,
|
|
||||||
$unit,
|
|
||||||
$water_mark_url,
|
|
||||||
array(),
|
|
||||||
array(),
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
'',
|
|
||||||
false,
|
|
||||||
'',
|
|
||||||
true,
|
|
||||||
$background_color,
|
$background_color,
|
||||||
$dashboard,
|
$dashboard,
|
||||||
$vconsole);
|
$vconsole);
|
||||||
@ -482,7 +414,6 @@ function stacked_line_graph($flash_chart, $chart_data, $width, $height,
|
|||||||
return "<img src='" . $homeurl . "include/graphs/functions_pchart.php?static_graph=1&graph_type=line&ttl=".$ttl."&id_graph=" . $id_graph . "' />";
|
return "<img src='" . $homeurl . "include/graphs/functions_pchart.php?static_graph=1&graph_type=line&ttl=".$ttl."&id_graph=" . $id_graph . "' />";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function stacked_bullet_chart($flash_chart, $chart_data, $width, $height,
|
function stacked_bullet_chart($flash_chart, $chart_data, $width, $height,
|
||||||
$color, $legend, $long_index, $no_data_image, $xaxisname = "",
|
$color, $legend, $long_index, $no_data_image, $xaxisname = "",
|
||||||
@ -551,6 +482,8 @@ function line_graph($flash_chart, $chart_data, $width, $height, $color,
|
|||||||
return '<img src="' . $no_data_image . '" />';
|
return '<img src="' . $no_data_image . '" />';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$menu = (!$dashboard && !$vconsole);
|
||||||
|
|
||||||
if ($flash_chart) {
|
if ($flash_chart) {
|
||||||
return flot_line_simple_graph(
|
return flot_line_simple_graph(
|
||||||
$chart_data,
|
$chart_data,
|
||||||
@ -569,30 +502,7 @@ function line_graph($flash_chart, $chart_data, $width, $height, $color,
|
|||||||
'',
|
'',
|
||||||
false,
|
false,
|
||||||
'',
|
'',
|
||||||
true,
|
$menu,
|
||||||
$backgroundColor,
|
|
||||||
$dashboard);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if ($vconsole) {
|
|
||||||
return flot_line_simple_graph(
|
|
||||||
$chart_data,
|
|
||||||
$width,
|
|
||||||
$height,
|
|
||||||
$color,
|
|
||||||
$legend,
|
|
||||||
$long_index,
|
|
||||||
$homeurl,
|
|
||||||
$unit,
|
|
||||||
$water_mark_url,
|
|
||||||
array(),
|
|
||||||
array(),
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
'',
|
|
||||||
false,
|
|
||||||
'',
|
|
||||||
true,
|
|
||||||
$backgroundColor,
|
$backgroundColor,
|
||||||
$dashboard,
|
$dashboard,
|
||||||
$vconsole);
|
$vconsole);
|
||||||
@ -616,7 +526,6 @@ function line_graph($flash_chart, $chart_data, $width, $height, $color,
|
|||||||
return "<img src='" . $homeurl . "include/graphs/functions_pchart.php?static_graph=1&graph_type=line&ttl=".$ttl."&id_graph=" . $id_graph . "' />";
|
return "<img src='" . $homeurl . "include/graphs/functions_pchart.php?static_graph=1&graph_type=line&ttl=".$ttl."&id_graph=" . $id_graph . "' />";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function kiviat_graph($graph_type, $flash_chart, $chart_data, $width,
|
function kiviat_graph($graph_type, $flash_chart, $chart_data, $width,
|
||||||
$height, $no_data_image, $ttl = 1, $homedir="") {
|
$height, $no_data_image, $ttl = 1, $homedir="") {
|
||||||
|
@ -42,7 +42,7 @@ else {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$refr = (int) get_parameter ('refr', $config['vc_refr']);
|
$refr = (int) get_parameter ('refr', $config['vc_refr']);
|
||||||
$graph_javascript = (bool) get_parameter ('graph_javascript', false);
|
$graph_javascript = (bool) get_parameter ('graph_javascript', true);
|
||||||
$vc_refr = false;
|
$vc_refr = false;
|
||||||
|
|
||||||
if (isset($config['vc_refr']) and $config['vc_refr'] != 0)
|
if (isset($config['vc_refr']) and $config['vc_refr'] != 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user