From 98b57ef6429443c64981d3841ecd79a6895ad9d5 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Thu, 1 Mar 2018 12:41:17 +0100 Subject: [PATCH] [SQL charts] Added breadcrumbs to sql charts --- pandora_console/include/functions_graph.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 7db2e8b99c..a1565361c7 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -3862,6 +3862,7 @@ function graph_custom_sql_graph ($id, $width, $height, $ttl = 1) { global $config; + $SQL_GRAPH_MAX_LABEL_SIZE = 20; $report_content = db_get_row ('treport_content', 'id_rc', $id); if($id != null){ @@ -3922,7 +3923,13 @@ function graph_custom_sql_graph ($id, $width, $height, } $label = __('Data'); if (!empty($data_item["label"])) { - $label = $data_item["label"]; + $label = io_safe_output($data_item["label"]); + if (strlen($label) > $SQL_GRAPH_MAX_LABEL_SIZE) { + $first_label = $label; + $label = substr($first_label, 0, floor($SQL_GRAPH_MAX_LABEL_SIZE/2)); + $label .= '...'; + $label .= substr($first_label, floor(-$SQL_GRAPH_MAX_LABEL_SIZE/2)); + } } switch ($type) { case 'sql_graph_vbar': // vertical bar