From 9d259a40970da065d04a859ed000a3f6ca924e2f Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 12 Jul 2022 16:18:17 +0200 Subject: [PATCH] #9029 Added starmap 3 --- pandora_console/include/functions_graph.php | 7 ++++++- pandora_console/include/graphs/fgraph.php | 12 ++++++++---- pandora_console/include/graphs/functions_flot.php | 4 ++++ .../operation/agentes/estado_generalagente.php | 1 + 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 4f471f31f1..11012b96eb 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -2558,7 +2558,8 @@ function combined_graph_summatory_average( function graphic_agentaccess( int $id_agent, int $period=0, - ?bool $return=false + ?bool $return=false, + ?bool $agent_view=false ) { global $config; @@ -2599,6 +2600,10 @@ function graphic_agentaccess( $options = []; $options['grid']['hoverable'] = true; + if ($agent_view === true) { + $options['agent_view'] = true; + } + if ($return === true) { return vbar_graph($data_array, $options, 1); } else { diff --git a/pandora_console/include/graphs/fgraph.php b/pandora_console/include/graphs/fgraph.php index b734fd3553..7082439384 100644 --- a/pandora_console/include/graphs/fgraph.php +++ b/pandora_console/include/graphs/fgraph.php @@ -494,7 +494,7 @@ function vbar_graph( 'weight' => $options['x']['font']['weight'], 'family' => $options['x']['font']['family'], 'variant' => $options['x']['font']['variant'], - 'color' => $options['x']['font']['color'], + 'color' => ($options['agent_view'] === true) ? 'black' : $options['x']['font']['color'], ], 'show' => $options['x']['show'], 'position' => $options['x']['position'], @@ -516,7 +516,7 @@ function vbar_graph( 'weight' => $options['y']['font']['weight'], 'family' => $options['y']['font']['family'], 'variant' => $options['y']['font']['variant'], - 'color' => $options['y']['font']['color'], + 'color' => ($options['agent_view'] === true) ? 'black' : $options['y']['font']['color'], ], 'show' => $options['y']['show'], 'position' => $options['y']['position'], @@ -534,8 +534,8 @@ function vbar_graph( 'aboveData' => $options['grid']['aboveData'], 'color' => $options['grid']['color'], 'backgroundColor' => $options['grid']['backgroundColor'], - 'margin' => $options['grid']['margin'], - 'labelMargin' => $options['grid']['labelMargin'], + 'margin' => ($options['agent_view'] === true) ? 6 : $options['grid']['margin'], + 'labelMargin' => ($options['agent_view'] === true) ? 12 : $options['grid']['labelMargin'], 'axisMargin' => $options['grid']['axisMargin'], 'markings' => $options['grid']['markings'], 'borderWidth' => $options['grid']['borderWidth'], @@ -561,6 +561,10 @@ function vbar_graph( ], ]; + if ($options['agent_view'] === true) { + $params['agent_view'] = true; + } + if (empty($params['data']) === true) { return graph_nodata_image( 0, diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php index 033382e5ea..8f5256e757 100644 --- a/pandora_console/include/graphs/functions_flot.php +++ b/pandora_console/include/graphs/functions_flot.php @@ -670,6 +670,10 @@ function flot_vcolumn_chart(array $options) $style .= 'height:'.$options['generals']['pdf']['height'].'px;'; } + if ($options['agent_view'] === true) { + $style = 'width: 95%; height: 85px'; + } + $class = ''; if ($options['generals']['rotate'] === true) { $class = 'bars-graph-rotate'; diff --git a/pandora_console/operation/agentes/estado_generalagente.php b/pandora_console/operation/agentes/estado_generalagente.php index 3b93f8edef..42d325e7f0 100755 --- a/pandora_console/operation/agentes/estado_generalagente.php +++ b/pandora_console/operation/agentes/estado_generalagente.php @@ -602,6 +602,7 @@ if ($config['agentaccess'] && $access_agent > 0) { $table_access_rate .= graphic_agentaccess( $id_agente, SECONDS_1DAY, + true, true ); $table_access_rate .= '';