From 424b51e9003c58da751f108f162b86c8764bb76d Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Wed, 6 Nov 2013 10:32:41 +0000 Subject: [PATCH] 2013-11-06 Sergio Martin * include/constants.php include/functions_graph.php: Added color collection in constants file and use it in custom graphs to avoid ugly black colors in graphs with more than three graphs Incident #346 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9012 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 8 ++++++++ pandora_console/include/constants.php | 10 +++++++++- pandora_console/include/functions_graph.php | 8 ++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 35392a110b..d0fb215539 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,11 @@ +2013-11-06 Sergio Martin + + * include/constants.php + include/functions_graph.php: Added color collection in + constants file and use it in custom graphs to avoid + ugly black colors in graphs with more than three graphs + Incident #346 + 2013-11-05 Sergio Martin * include/api.php: Create a special call on Pandora FMS diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php index 711ec3b306..f6b2a452e8 100644 --- a/pandora_console/include/constants.php +++ b/pandora_console/include/constants.php @@ -131,6 +131,14 @@ define('COL_MAJOR','#C97A4A'); define('COL_INFORMATIONAL','#E4E4E4'); define('COL_MAINTENANCE','#3BA0FF'); +define('COL_GRAPH1', '#C397F2'); +define('COL_GRAPH2', '#FFE66C'); +define('COL_GRAPH3', '#92CCA3'); +define('COL_GRAPH4', '#EA6D5B'); +define('COL_GRAPH5', '#6BD8DD'); +define('COL_GRAPH6', '#F49B31'); +define('COL_GRAPH7', '#999999'); +define('COL_GRAPH8', '#F2B8C1'); /* The styles */ @@ -342,4 +350,4 @@ define("EVENTS_GOING_DOWN_NORMAL", 'going_down_normal'); define("EVENTS_GOING_DOWN_CRITICAL", 'going_down_critical'); define("EVENTS_GOING_UP_NORMAL", 'going_up_normal'); define("EVENTS_CONFIGURATION_CHANGE", 'configuration_change'); -?> \ No newline at end of file +?> diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index e265be9ae7..4aff43d4c3 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1230,6 +1230,14 @@ function graphic_combined_module ($module_list, $weight_list, $period, $width, $ $color[0] = array('border' => '#000000', 'color' => $config['graph_color1'], 'alpha' => 50); $color[1] = array('border' => '#000000', 'color' => $config['graph_color2'], 'alpha' => 50); $color[2] = array('border' => '#000000', 'color' => $config['graph_color3'], 'alpha' => 50); + $color[3] = array('border' => '#000000', 'color' => COL_GRAPH1, 'alpha' => 50); + $color[4] = array('border' => '#000000', 'color' => COL_GRAPH2, 'alpha' => 50); + $color[5] = array('border' => '#000000', 'color' => COL_GRAPH3, 'alpha' => 50); + $color[6] = array('border' => '#000000', 'color' => COL_GRAPH4, 'alpha' => 50); + $color[7] = array('border' => '#000000', 'color' => COL_GRAPH5, 'alpha' => 50); + $color[8] = array('border' => '#000000', 'color' => COL_GRAPH6, 'alpha' => 50); + $color[9] = array('border' => '#000000', 'color' => COL_GRAPH7, 'alpha' => 50); + $color[10] = array('border' => '#000000', 'color' => COL_GRAPH8, 'alpha' => 50); switch ($stacked) { case GRAPH_AREA: