[SQL charts reports] Added top n report to set the maximum number of elements
This commit is contained in:
parent
6e62f4c023
commit
b6688dda1c
|
@ -3925,7 +3925,7 @@ function graph_custom_sql_graph ($id, $width, $height,
|
|||
$label = __('Data');
|
||||
if (!empty($data_item["label"])) {
|
||||
$label = io_safe_output($data_item["label"]);
|
||||
if ((strlen($label) > $SQL_GRAPH_MAX_LABEL_SIZE) && ($type !== 'sql_graph_vbar')) {
|
||||
if (strlen($label) > $SQL_GRAPH_MAX_LABEL_SIZE) {
|
||||
$first_label = $label;
|
||||
$label = substr($first_label, 0, floor($SQL_GRAPH_MAX_LABEL_SIZE/2));
|
||||
$label .= '...';
|
||||
|
|
|
@ -3294,7 +3294,8 @@ function reporting_sql_graph($report, $content, $type,
|
|||
$content["type"],
|
||||
true,
|
||||
ui_get_full_url(false, false, false, false),
|
||||
$ttl);
|
||||
$ttl,
|
||||
$content['top_n_value']);
|
||||
break;
|
||||
case 'data':
|
||||
break;
|
||||
|
|
|
@ -190,14 +190,12 @@ function vbar_graph(
|
|||
else {
|
||||
$new_chart_data = array();
|
||||
foreach ($chart_data as $key => $value) {
|
||||
if(strlen($key) > 20){
|
||||
if(strpos($key, ' - ') != -1){
|
||||
$key_temp = explode(" - ",$key);
|
||||
$key_temp[0] = $key_temp[0]." \n";
|
||||
$key_temp[1]= '...'.substr($key_temp[1],-15);
|
||||
$key2 = $key_temp[0].$key_temp[1];
|
||||
io_safe_output($key2);
|
||||
}
|
||||
if(strlen($key) > 20 && strpos($key, ' - ') != -1){
|
||||
$key_temp = explode(" - ",$key);
|
||||
$key_temp[0] = $key_temp[0]." \n";
|
||||
$key_temp[1]= '...'.substr($key_temp[1],-15);
|
||||
$key2 = $key_temp[0].$key_temp[1];
|
||||
io_safe_output($key2);
|
||||
$new_chart_data[$key2]['g'] = $chart_data[$key]['g'];
|
||||
} else {
|
||||
$new_chart_data[$key] = $value;
|
||||
|
|
Loading…
Reference in New Issue