mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
Merge branch '1827-Graficas_TIP_eje_x_no_mantiene_ratio' into 'develop'
1827 graficas tip eje x no mantiene ratio See merge request artica/pandorafms!1538
This commit is contained in:
commit
3a4f3a38be
@ -2926,8 +2926,6 @@ function chooseType() {
|
|||||||
$("#row_agent").show();
|
$("#row_agent").show();
|
||||||
$("#row_module").show();
|
$("#row_module").show();
|
||||||
$("#row_period").show();
|
$("#row_period").show();
|
||||||
$("#row_show_in_landscape").show();
|
|
||||||
$("#row_time_compare_overlapped").show();
|
|
||||||
$("#row_historical_db_check").hide();
|
$("#row_historical_db_check").hide();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -2937,8 +2935,6 @@ function chooseType() {
|
|||||||
$("#row_module").show();
|
$("#row_module").show();
|
||||||
$("#row_period1").show();
|
$("#row_period1").show();
|
||||||
$("#row_estimate").show();
|
$("#row_estimate").show();
|
||||||
$("#row_show_in_two_columns").show();
|
|
||||||
$("#row_show_in_landscape").show();
|
|
||||||
$("#row_historical_db_check").hide();
|
$("#row_historical_db_check").hide();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -2957,8 +2953,6 @@ function chooseType() {
|
|||||||
$("#row_description").show();
|
$("#row_description").show();
|
||||||
$("#row_period").show();
|
$("#row_period").show();
|
||||||
$("#row_custom_graph").show();
|
$("#row_custom_graph").show();
|
||||||
$("#row_show_in_two_columns").show();
|
|
||||||
$("#row_show_in_landscape").show();
|
|
||||||
$("#row_historical_db_check").hide();
|
$("#row_historical_db_check").hide();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -3116,9 +3110,7 @@ function chooseType() {
|
|||||||
$("#row_description").show();
|
$("#row_description").show();
|
||||||
$("#row_query").show();
|
$("#row_query").show();
|
||||||
$("#row_max_items").show();
|
$("#row_max_items").show();
|
||||||
$("#row_show_in_two_columns").show();
|
|
||||||
$("#row_dyn_height").show();
|
$("#row_dyn_height").show();
|
||||||
$("#row_show_in_landscape").show();
|
|
||||||
$("#row_servers").show();
|
$("#row_servers").show();
|
||||||
$("#row_historical_db_check").show();
|
$("#row_historical_db_check").show();
|
||||||
break;
|
break;
|
||||||
|
@ -3053,10 +3053,20 @@ function series_type_graph_array($data, $show_elements_graph){
|
|||||||
|
|
||||||
if($show_elements_graph['id_widget_dashboard']){
|
if($show_elements_graph['id_widget_dashboard']){
|
||||||
$opcion = unserialize(db_get_value_filter('options','twidget_dashboard',array('id' => $show_elements_graph['id_widget_dashboard'])));
|
$opcion = unserialize(db_get_value_filter('options','twidget_dashboard',array('id' => $show_elements_graph['id_widget_dashboard'])));
|
||||||
foreach ($opcion as $key => $value) {
|
if($show_elements_graph['graph_combined']){
|
||||||
|
|
||||||
|
foreach ($show_elements_graph['modules_id'] as $key => $value) {
|
||||||
|
$color_series[$key] = array(
|
||||||
|
'border' => '#000000',
|
||||||
|
'color' => $opcion[$value],
|
||||||
|
'alpha' => CHART_DEFAULT_ALPHA
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
$color_series[0] = array(
|
$color_series[0] = array(
|
||||||
'border' => '#000000',
|
'border' => '#000000',
|
||||||
'color' => $opcion['avg'],
|
'color' => $opcion['max'],
|
||||||
'alpha' => CHART_DEFAULT_ALPHA
|
'alpha' => CHART_DEFAULT_ALPHA
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ function config_create_value ($token, $value) {
|
|||||||
*/
|
*/
|
||||||
function config_update_value ($token, $value) {
|
function config_update_value ($token, $value) {
|
||||||
global $config;
|
global $config;
|
||||||
|
$config['flash_charts'] = true;
|
||||||
// Include functions_io to can call __() function
|
// Include functions_io to can call __() function
|
||||||
include_once($config['homedir'] . '/include/functions_io.php');
|
include_once($config['homedir'] . '/include/functions_io.php');
|
||||||
|
|
||||||
|
@ -701,7 +701,8 @@ function grafico_modulo_sparse_data(
|
|||||||
'show_overview' => true,
|
'show_overview' => true,
|
||||||
'return_img_base_64' => false,
|
'return_img_base_64' => false,
|
||||||
'image_treshold' => false,
|
'image_treshold' => false,
|
||||||
'graph_combined' => false
|
'graph_combined' => false,
|
||||||
|
'zoom' => 1
|
||||||
);
|
);
|
||||||
*/
|
*/
|
||||||
function grafico_modulo_sparse ($params) {
|
function grafico_modulo_sparse ($params) {
|
||||||
@ -873,7 +874,7 @@ function grafico_modulo_sparse ($params) {
|
|||||||
$params['grid_color'] = '#C1C1C1';
|
$params['grid_color'] = '#C1C1C1';
|
||||||
$params['legend_color'] = '#636363';
|
$params['legend_color'] = '#636363';
|
||||||
$params['font'] = $config['fontpath'];
|
$params['font'] = $config['fontpath'];
|
||||||
$params['font-size'] = $config['font_size'];
|
$params['font_size'] = $config['font_size'];
|
||||||
$params['short_data'] = $config['short_module_graph_data'];
|
$params['short_data'] = $config['short_module_graph_data'];
|
||||||
|
|
||||||
if($params['only_image']){
|
if($params['only_image']){
|
||||||
@ -1084,22 +1085,6 @@ function grafico_modulo_sparse ($params) {
|
|||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function graph_get_formatted_date($timestamp, $format1, $format2) {
|
|
||||||
global $config;
|
|
||||||
|
|
||||||
if ($config['flash_charts']) {
|
|
||||||
$date = date("$format1 $format2", $timestamp);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$date = date($format1, $timestamp);
|
|
||||||
if ($format2 != '') {
|
|
||||||
$date .= "\n".date($format2, $timestamp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $date;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Produces a combined/user defined graph
|
* Produces a combined/user defined graph
|
||||||
*
|
*
|
||||||
@ -1168,6 +1153,8 @@ function graphic_combined_module (
|
|||||||
$params_combined
|
$params_combined
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
global $config;
|
||||||
|
|
||||||
if(!isset($params_combined['from_interface'])){
|
if(!isset($params_combined['from_interface'])){
|
||||||
$params_combined['from_interface'] = false;
|
$params_combined['from_interface'] = false;
|
||||||
}
|
}
|
||||||
@ -1182,11 +1169,11 @@ function graphic_combined_module (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ($id_graph == 0) {
|
if ($params_combined['id_graph'] == 0) {
|
||||||
$params_combined['stacked'] = CUSTOM_GRAPH_AREA;
|
$params_combined['stacked'] = CUSTOM_GRAPH_AREA;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$params_combined['stacked'] = db_get_row('tgraph', 'id_graph', $id_graph);
|
$params_combined['stacked'] = db_get_row('tgraph', 'id_graph', $params_combined['id_graph']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1334,6 +1321,7 @@ function graphic_combined_module (
|
|||||||
}
|
}
|
||||||
|
|
||||||
$params['graph_combined'] = true;
|
$params['graph_combined'] = true;
|
||||||
|
$params_combined['graph_combined'] = true;
|
||||||
|
|
||||||
if($params['only_image']){
|
if($params['only_image']){
|
||||||
return generator_chart_to_pdf('combined', $params, $params_combined, $module_list);
|
return generator_chart_to_pdf('combined', $params, $params_combined, $module_list);
|
||||||
@ -1348,13 +1336,15 @@ function graphic_combined_module (
|
|||||||
$params['grid_color'] = '#C1C1C1';
|
$params['grid_color'] = '#C1C1C1';
|
||||||
$params['legend_color'] = '#636363';
|
$params['legend_color'] = '#636363';
|
||||||
$params['font'] = $config['fontpath'];
|
$params['font'] = $config['fontpath'];
|
||||||
$params['font-size'] = $config['font_size'];
|
$params['font_size'] = $config['font_size'];
|
||||||
|
|
||||||
$params['short_data'] = $config['short_module_graph_data'];
|
$params['short_data'] = $config['short_module_graph_data'];
|
||||||
|
|
||||||
global $config;
|
global $config;
|
||||||
global $graphic_type;
|
global $graphic_type;
|
||||||
|
|
||||||
$sources = false;
|
$sources = false;
|
||||||
|
|
||||||
if ($params_combined['id_graph'] == 0) {
|
if ($params_combined['id_graph'] == 0) {
|
||||||
$count_modules = count($module_list);
|
$count_modules = count($module_list);
|
||||||
|
|
||||||
@ -1402,6 +1392,13 @@ function graphic_combined_module (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($module_list){
|
||||||
|
$params_combined['modules_id'] = $module_list;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$params_combined['modules_id'] = $modules;
|
||||||
|
}
|
||||||
|
|
||||||
if(isset($summatory)){
|
if(isset($summatory)){
|
||||||
$params_combined['summatory'] = $summatory;
|
$params_combined['summatory'] = $summatory;
|
||||||
}
|
}
|
||||||
@ -1543,6 +1540,8 @@ function graphic_combined_module (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($params_combined['projection'] && is_array($params_combined['projection'])){
|
if($params_combined['projection'] && is_array($params_combined['projection'])){
|
||||||
|
$date_array_projection = max($params_combined['projection']);
|
||||||
|
$date_array['final_date'] = $date_array_projection[0] / 1000;
|
||||||
$array_data['projection']['data']= $params_combined['projection'];
|
$array_data['projection']['data']= $params_combined['projection'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2252,7 +2251,7 @@ function graphic_agentaccess ($id_agent, $width, $height, $period = 0, $return =
|
|||||||
'backgroundColor' => '#f9faf9',
|
'backgroundColor' => '#f9faf9',
|
||||||
'type_graph' => 'area',
|
'type_graph' => 'area',
|
||||||
'font' => $config['fontpath'],
|
'font' => $config['fontpath'],
|
||||||
'font-size' => $config['font_size'],
|
'font_size' => $config['font_size'],
|
||||||
'array_data_create' => $data_array,
|
'array_data_create' => $data_array,
|
||||||
'show_overview' => false,
|
'show_overview' => false,
|
||||||
'show_export_csv' => false,
|
'show_export_csv' => false,
|
||||||
@ -4123,7 +4122,7 @@ function graph_netflow_aggregate_area ($data, $period, $width, $height, $unit =
|
|||||||
'backgroundColor' => 'white',
|
'backgroundColor' => 'white',
|
||||||
'type_graph' => 'area',
|
'type_graph' => 'area',
|
||||||
'font' => $config['fontpath'],
|
'font' => $config['fontpath'],
|
||||||
'font-size' => $config['font_size'],
|
'font_size' => $config['font_size'],
|
||||||
'array_data_create' => $chart
|
'array_data_create' => $chart
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -4184,7 +4183,7 @@ function graph_netflow_total_area ($data, $period, $width, $height, $unit = '',
|
|||||||
'backgroundColor' => 'white',
|
'backgroundColor' => 'white',
|
||||||
'type_graph' => 'area',
|
'type_graph' => 'area',
|
||||||
'font' => $config['fontpath'],
|
'font' => $config['fontpath'],
|
||||||
'font-size' => $config['font_size'],
|
'font_size' => $config['font_size'],
|
||||||
'array_data_create' => $chart
|
'array_data_create' => $chart
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -6295,77 +6295,12 @@ function reporting_custom_graph($report, $content, $type = 'dinamic',
|
|||||||
$report,
|
$report,
|
||||||
$content);
|
$content);
|
||||||
|
|
||||||
$graphs = db_get_all_rows_field_filter ("tgraph_source",
|
$graphs = db_get_all_rows_field_filter ("tgraph", "id_graph", $content['id_gs']);
|
||||||
"id_graph", $content['id_gs']);
|
|
||||||
$modules = array ();
|
|
||||||
$weights = array ();
|
|
||||||
if ($graphs === false)
|
|
||||||
$graphs = array();
|
|
||||||
|
|
||||||
$labels = array();
|
|
||||||
foreach ($graphs as $graph_item) {
|
|
||||||
if ($type_report == 'automatic_graph') {
|
|
||||||
array_push ($modules, array(
|
|
||||||
'module' => $graph_item['id_agent_module'],
|
|
||||||
'server' => $graph_item['id_server']));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
array_push ($modules, $graph_item['id_agent_module']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (in_array('label',$content['style'])) {
|
|
||||||
if (defined('METACONSOLE')) {
|
|
||||||
$server_name = $content['server_name'];
|
|
||||||
$connection = metaconsole_get_connection($server_name);
|
|
||||||
if (!metaconsole_load_external_db($connection)) {
|
|
||||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$item = array('type' => 'custom_graph',
|
|
||||||
'id_agent' =>modules_get_agentmodule_agent($graph_item['id_agent_module']),
|
|
||||||
'id_agent_module'=>$graph_item['id_agent_module']);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$item = array('type' => 'custom_graph',
|
|
||||||
'id_agent' =>modules_get_agentmodule_agent($graph_item['id_agent_module']),
|
|
||||||
'id_agent_module'=>$graph_item['id_agent_module']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$label = reporting_label_macro($item, $content['style']['label']);
|
|
||||||
|
|
||||||
$labels[$graph_item['id_agent_module']] = $label;
|
|
||||||
if (defined('METACONSOLE')) {
|
|
||||||
//Restore db connection
|
|
||||||
metaconsole_restore_db();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
array_push ($weights, $graph_item["weight"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($config['metaconsole'] && $type_report != 'automatic_graph') {
|
|
||||||
$id_meta = metaconsole_get_id_server($content["server_name"]);
|
|
||||||
$server = metaconsole_get_connection_by_id ($id_meta);
|
|
||||||
metaconsole_connect($server);
|
|
||||||
}
|
|
||||||
|
|
||||||
$return['chart'] = '';
|
$return['chart'] = '';
|
||||||
// Get chart
|
|
||||||
//reporting_set_conf_charts($width, $height, $only_image, $type,
|
|
||||||
// $content, $ttl);
|
|
||||||
$width =null;
|
$width =null;
|
||||||
$height =null;
|
$height =null;
|
||||||
//height for bullet chart
|
|
||||||
/*
|
|
||||||
if($graph['stacked'] != 4){
|
|
||||||
$height += count($modules) * REPORTING_CUSTOM_GRAPH_LEGEND_EACH_MODULE_VERTICAL_SIZE;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
if(!$only_image){
|
|
||||||
$height = 50;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'dinamic':
|
case 'dinamic':
|
||||||
@ -6379,17 +6314,16 @@ $height =null;
|
|||||||
'only_image' => $pdf,
|
'only_image' => $pdf,
|
||||||
'homeurl' => ui_get_full_url(false, false, false, false),
|
'homeurl' => ui_get_full_url(false, false, false, false),
|
||||||
'ttl' => $ttl,
|
'ttl' => $ttl,
|
||||||
'percentil' => $graph["percentil"],
|
'percentil' => $graphs[0]["percentil"],
|
||||||
'fullscale' => $graph["fullscale"],
|
'fullscale' => $graphs[0]["fullscale"],
|
||||||
);
|
);
|
||||||
|
|
||||||
$params_combined = array(
|
$params_combined = array(
|
||||||
'weight_list' => $weights,
|
'stacked' => $graphs[0]["stacked"],
|
||||||
'stacked' => $graph["stacked"],
|
'summatory' => $graphs[0]["summatory_series"],
|
||||||
'labels' => $labels,
|
'average' => $graphs[0]["average_series"],
|
||||||
'summatory' => $graph["summatory_series"],
|
'modules_series' => $graphs[0]["modules_series"],
|
||||||
'average' => $graph["average_series"],
|
'id_graph' => $content['id_gs']
|
||||||
'modules_series' => $graph["modules_series"]
|
|
||||||
);
|
);
|
||||||
|
|
||||||
$return['chart'] = graphic_combined_module(
|
$return['chart'] = graphic_combined_module(
|
||||||
|
@ -965,6 +965,8 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||||||
$height = 480;
|
$height = 480;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$graphs = db_get_all_rows_field_filter ("tgraph", "id_graph", $layoutData['id_custom_graph']);
|
||||||
|
|
||||||
$params =array(
|
$params =array(
|
||||||
'period' => $period,
|
'period' => $period,
|
||||||
'width' => $width,
|
'width' => $width,
|
||||||
@ -978,7 +980,11 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||||||
);
|
);
|
||||||
|
|
||||||
$params_combined = array(
|
$params_combined = array(
|
||||||
'id_graph' => $layoutData['id_custom_graph']
|
'id_graph' => $layoutData['id_custom_graph'],
|
||||||
|
'stacked' => $graphs[0]["stacked"],
|
||||||
|
'summatory' => $graphs[0]["summatory_series"],
|
||||||
|
'average' => $graphs[0]["average_series"],
|
||||||
|
'modules_series' => $graphs[0]["modules_series"]
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($layoutData['label_position']=='left') {
|
if ($layoutData['label_position']=='left') {
|
||||||
|
@ -861,12 +861,11 @@ function pandoraFlotArea( graph_id, values, legend,
|
|||||||
series_type, color, water_mark, date_array,
|
series_type, color, water_mark, date_array,
|
||||||
data_module_graph, params, events_array
|
data_module_graph, params, events_array
|
||||||
) {
|
) {
|
||||||
|
|
||||||
//diferents vars
|
//diferents vars
|
||||||
var unit = params.unit ? params.unit : '';
|
var unit = params.unit ? params.unit : '';
|
||||||
var homeurl = params.homeurl;
|
var homeurl = params.homeurl;
|
||||||
var font_size = params.font_size;
|
var font_size = parseInt(params.font_size);
|
||||||
var font = params.font;
|
var font = params.font.split("/").pop().split(".").shift();
|
||||||
var width = params.width;
|
var width = params.width;
|
||||||
var height = params.height;
|
var height = params.height;
|
||||||
var vconsole = params.vconsole;
|
var vconsole = params.vconsole;
|
||||||
@ -874,7 +873,7 @@ function pandoraFlotArea( graph_id, values, legend,
|
|||||||
var menu = params.menu;
|
var menu = params.menu;
|
||||||
var min_x = date_array['start_date'] *1000;
|
var min_x = date_array['start_date'] *1000;
|
||||||
var max_x = date_array['final_date'] *1000;
|
var max_x = date_array['final_date'] *1000;
|
||||||
var type = params.stacked;
|
var type = parseInt(params.stacked);
|
||||||
var show_legend = params.show_legend;
|
var show_legend = params.show_legend;
|
||||||
var image_treshold = params.image_treshold;
|
var image_treshold = params.image_treshold;
|
||||||
var short_data = params.short_data;
|
var short_data = params.short_data;
|
||||||
@ -1584,8 +1583,6 @@ function pandoraFlotArea( graph_id, values, legend,
|
|||||||
|
|
||||||
// minTickSize
|
// minTickSize
|
||||||
var count_data = datas[0].data.length;
|
var count_data = datas[0].data.length;
|
||||||
var min_tick = datas[0].data[0][0];
|
|
||||||
var max_tick = datas[0].data[count_data - 1][0];
|
|
||||||
|
|
||||||
var number_ticks = 8;
|
var number_ticks = 8;
|
||||||
if(vconsole){
|
if(vconsole){
|
||||||
@ -1593,7 +1590,7 @@ function pandoraFlotArea( graph_id, values, legend,
|
|||||||
}
|
}
|
||||||
|
|
||||||
var maxticks = date_array['period'] / 3600 / number_ticks;
|
var maxticks = date_array['period'] / 3600 / number_ticks;
|
||||||
console.log(grid_color);
|
|
||||||
var options = {
|
var options = {
|
||||||
series: {
|
series: {
|
||||||
stack: stacked,
|
stack: stacked,
|
||||||
@ -1623,27 +1620,29 @@ console.log(grid_color);
|
|||||||
},
|
},
|
||||||
xaxis: {
|
xaxis: {
|
||||||
min: min_x,
|
min: min_x,
|
||||||
max: max_x
|
max: max_x,
|
||||||
|
font: {
|
||||||
|
size: font_size + 2,
|
||||||
|
color: legend_color,
|
||||||
|
family: font+'Font'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
xaxes: [{
|
xaxes: [{
|
||||||
axisLabelUseCanvas: true,
|
|
||||||
axisLabelFontSizePixels: font_size,
|
|
||||||
axisLabelFontFamily: font+'Font',
|
|
||||||
axisLabelPadding: 0,
|
|
||||||
mode: "time",
|
mode: "time",
|
||||||
timezone: "browser",
|
timezone: "browser",
|
||||||
localTimezone: true,
|
localTimezone: true,
|
||||||
//tickFormatter: xFormatter,
|
|
||||||
tickSize: [maxticks, 'hour']
|
tickSize: [maxticks, 'hour']
|
||||||
}],
|
}],
|
||||||
|
yaxis: {
|
||||||
|
font: {
|
||||||
|
size: font_size + 2,
|
||||||
|
color: legend_color,
|
||||||
|
family: font+'Font'
|
||||||
|
},
|
||||||
|
},
|
||||||
yaxes: [{
|
yaxes: [{
|
||||||
tickFormatter: yFormatter,
|
tickFormatter: yFormatter,
|
||||||
color: '',
|
position: 'left'
|
||||||
alignTicksWithAxis: 1,
|
|
||||||
labelWidth: 30,
|
|
||||||
position: 'left',
|
|
||||||
font: font,
|
|
||||||
reserveSpace: true
|
|
||||||
}],
|
}],
|
||||||
legend: {
|
legend: {
|
||||||
position: 'se',
|
position: 'se',
|
||||||
@ -1725,27 +1724,29 @@ if (vconsole) {
|
|||||||
},
|
},
|
||||||
xaxis: {
|
xaxis: {
|
||||||
min: date_array.start_date * 1000,
|
min: date_array.start_date * 1000,
|
||||||
max: date_array.final_date * 1000
|
max: date_array.final_date * 1000,
|
||||||
|
font: {
|
||||||
|
size: font_size + 2,
|
||||||
|
color: legend_color,
|
||||||
|
family: font+'Font'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
xaxes: [{
|
xaxes: [{
|
||||||
axisLabelUseCanvas: true,
|
|
||||||
axisLabelFontSizePixels: font_size,
|
|
||||||
axisLabelFontFamily: font+'Font',
|
|
||||||
axisLabelPadding: 0,
|
|
||||||
mode: "time",
|
mode: "time",
|
||||||
timezone: "browser",
|
timezone: "browser",
|
||||||
localTimezone: true,
|
localTimezone: true,
|
||||||
//tickFormatter: xFormatter,
|
|
||||||
tickSize: [maxticks, 'hour']
|
tickSize: [maxticks, 'hour']
|
||||||
}],
|
}],
|
||||||
|
yaxis: {
|
||||||
|
font: {
|
||||||
|
size: font_size + 2,
|
||||||
|
color: legend_color,
|
||||||
|
family: font+'Font'
|
||||||
|
},
|
||||||
|
},
|
||||||
yaxes: [{
|
yaxes: [{
|
||||||
tickFormatter: yFormatter,
|
tickFormatter: yFormatter,
|
||||||
color: '',
|
position: 'left'
|
||||||
alignTicksWithAxis: 1,
|
|
||||||
labelWidth: 30,
|
|
||||||
position: 'left',
|
|
||||||
font: font,
|
|
||||||
reserveSpace: true
|
|
||||||
}],
|
}],
|
||||||
legend: {
|
legend: {
|
||||||
position: 'se',
|
position: 'se',
|
||||||
@ -1755,8 +1756,6 @@ if (vconsole) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#legend_' + graph_id + ' .legendLabel').css('color', legend_color);
|
|
||||||
|
|
||||||
// Adjust overview when main chart is resized
|
// Adjust overview when main chart is resized
|
||||||
$('#overview_'+graph_id).resize(function(){
|
$('#overview_'+graph_id).resize(function(){
|
||||||
update_left_width_canvas(graph_id);
|
update_left_width_canvas(graph_id);
|
||||||
@ -1800,31 +1799,31 @@ if (vconsole) {
|
|||||||
},
|
},
|
||||||
xaxis: {
|
xaxis: {
|
||||||
min: ranges.xaxis.from,
|
min: ranges.xaxis.from,
|
||||||
max: ranges.xaxis.to
|
max: ranges.xaxis.to,
|
||||||
|
font: {
|
||||||
|
size: font_size + 2,
|
||||||
|
color: legend_color,
|
||||||
|
family: font+'Font'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
xaxes: [{
|
xaxes: [{
|
||||||
axisLabelUseCanvas: true,
|
|
||||||
axisLabelFontSizePixels: font_size,
|
|
||||||
axisLabelFontFamily: font+'Font',
|
|
||||||
axisLabelPadding: 0,
|
|
||||||
mode: "time",
|
mode: "time",
|
||||||
timezone: "browser",
|
timezone: "browser",
|
||||||
localTimezone: true,
|
localTimezone: true,
|
||||||
//tickFormatter: xFormatter,
|
|
||||||
tickSize: [maxticks_zoom, 'hour']
|
tickSize: [maxticks_zoom, 'hour']
|
||||||
}],
|
}],
|
||||||
yaxis:{
|
yaxis:{
|
||||||
min: ranges.yaxis.from,
|
min: ranges.yaxis.from,
|
||||||
max: ranges.yaxis.to
|
max: ranges.yaxis.to,
|
||||||
|
font: {
|
||||||
|
size: font_size + 2,
|
||||||
|
color: legend_color,
|
||||||
|
family: font+'Font'
|
||||||
|
},
|
||||||
},
|
},
|
||||||
yaxes: [{
|
yaxes: [{
|
||||||
tickFormatter: yFormatter,
|
tickFormatter: yFormatter,
|
||||||
color: '',
|
position: 'left'
|
||||||
alignTicksWithAxis: 1,
|
|
||||||
labelWidth: 30,
|
|
||||||
position: 'left',
|
|
||||||
font: font,
|
|
||||||
reserveSpace: true,
|
|
||||||
}],
|
}],
|
||||||
legend: {
|
legend: {
|
||||||
show: true
|
show: true
|
||||||
@ -1841,31 +1840,31 @@ if (vconsole) {
|
|||||||
},
|
},
|
||||||
xaxis: {
|
xaxis: {
|
||||||
min: ranges.xaxis.from,
|
min: ranges.xaxis.from,
|
||||||
max: ranges.xaxis.to
|
max: ranges.xaxis.to,
|
||||||
|
font: {
|
||||||
|
size: font_size + 2,
|
||||||
|
color: legend_color,
|
||||||
|
family: font+'Font'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
xaxes: [{
|
xaxes: [{
|
||||||
axisLabelUseCanvas: true,
|
|
||||||
axisLabelFontSizePixels: font_size,
|
|
||||||
axisLabelFontFamily: font+'Font',
|
|
||||||
axisLabelPadding: 0,
|
|
||||||
mode: "time",
|
mode: "time",
|
||||||
timezone: "browser",
|
timezone: "browser",
|
||||||
localTimezone: true,
|
localTimezone: true,
|
||||||
//tickFormatter: xFormatter,
|
|
||||||
tickSize: [maxticks_zoom, 'hour']
|
tickSize: [maxticks_zoom, 'hour']
|
||||||
}],
|
}],
|
||||||
yaxis:{
|
yaxis:{
|
||||||
min: ranges.yaxis.from,
|
min: ranges.yaxis.from,
|
||||||
max: ranges.yaxis.to
|
max: ranges.yaxis.to,
|
||||||
|
font: {
|
||||||
|
size: font_size + 2,
|
||||||
|
color: legend_color,
|
||||||
|
family: font+'Font'
|
||||||
|
},
|
||||||
},
|
},
|
||||||
yaxes: [{
|
yaxes: [{
|
||||||
tickFormatter: yFormatter,
|
tickFormatter: yFormatter,
|
||||||
color: '',
|
position: 'left'
|
||||||
alignTicksWithAxis: 1,
|
|
||||||
labelWidth: 30,
|
|
||||||
position: 'left',
|
|
||||||
font: font,
|
|
||||||
reserveSpace: true,
|
|
||||||
}],
|
}],
|
||||||
legend: {
|
legend: {
|
||||||
show: true
|
show: true
|
||||||
@ -1930,6 +1929,11 @@ if (vconsole) {
|
|||||||
$('#timestamp_'+graph_id).height() +
|
$('#timestamp_'+graph_id).height() +
|
||||||
$('#legend_' + graph_id).height());
|
$('#legend_' + graph_id).height());
|
||||||
|
|
||||||
|
$('#timestamp_'+graph_id).css('color', legend_color);
|
||||||
|
$('#timestamp_'+graph_id).css('font-size', font_size + 2);
|
||||||
|
$('#timestamp_'+graph_id).css('font-family', font + 'Font');
|
||||||
|
$('#timestamp_'+graph_id).css('color', legend_color);
|
||||||
|
|
||||||
if (timesize+timenewpos > canvaslimit) {
|
if (timesize+timenewpos > canvaslimit) {
|
||||||
$('#timestamp_'+graph_id).css('left', timenewpos - timesize);
|
$('#timestamp_'+graph_id).css('left', timenewpos - timesize);
|
||||||
}
|
}
|
||||||
@ -1990,14 +1994,7 @@ if (vconsole) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#legend_' + graph_id + ' .legendLabel')
|
$('#legend_' + graph_id + ' .legendLabel').eq(i).css('color', legend_color);
|
||||||
.eq(i).css('font-size',font_size+'pt');
|
|
||||||
|
|
||||||
$('#legend_' + graph_id + ' .legendLabel')
|
|
||||||
.eq(i).css('color', legend_color);
|
|
||||||
|
|
||||||
$('#legend_' + graph_id + ' .legendLabel')
|
|
||||||
.eq(i).css('font-family',font);
|
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
@ -2163,34 +2160,13 @@ if (vconsole) {
|
|||||||
$('#legend_' + graph_id + ' .legendLabel')
|
$('#legend_' + graph_id + ' .legendLabel')
|
||||||
.eq(i).html(label_aux);
|
.eq(i).html(label_aux);
|
||||||
}
|
}
|
||||||
|
$('#legend_' + graph_id + ' .legendLabel').css('color', legend_color);
|
||||||
plot.clearCrosshair();
|
plot.clearCrosshair();
|
||||||
if(!vconsole){
|
if(!vconsole){
|
||||||
overview.clearCrosshair();
|
overview.clearCrosshair();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Format functions
|
|
||||||
function xFormatter(v, axis) {
|
|
||||||
var d = new Date(v);
|
|
||||||
var result_date_format = 0;
|
|
||||||
|
|
||||||
var monthNames = [
|
|
||||||
"Jan", "Feb", "Mar",
|
|
||||||
"Apr", "May", "Jun",
|
|
||||||
"Jul", "Aug", "Sep",
|
|
||||||
"Oct", "Nov", "Dec"
|
|
||||||
];
|
|
||||||
|
|
||||||
result_date_format = (d.getDate() <10?'0':'') + d.getDate() + " " +
|
|
||||||
monthNames[d.getMonth()] + " " +
|
|
||||||
d.getFullYear() + "\n" +
|
|
||||||
(d.getHours()<10?'0':'') + d.getHours() + ":" +
|
|
||||||
(d.getMinutes()<10?'0':'') + d.getMinutes() + ":" +
|
|
||||||
(d.getSeconds()<10?'0':'') + d.getSeconds();
|
|
||||||
|
|
||||||
return '<div class='+font+' style="font-size:'+font_size+'pt; margin-top:15px;">'+result_date_format+'</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
function yFormatter(v, axis) {
|
function yFormatter(v, axis) {
|
||||||
axis.datamin = 0;
|
axis.datamin = 0;
|
||||||
if (short_data) {
|
if (short_data) {
|
||||||
@ -2207,25 +2183,19 @@ if (vconsole) {
|
|||||||
|
|
||||||
// Get only two decimals
|
// Get only two decimals
|
||||||
formatted = round_with_decimals(formatted, 100);
|
formatted = round_with_decimals(formatted, 100);
|
||||||
return '<div class='+font+' style="font-size:'+font_size+'pt;">'+formatted+'</div>';
|
return formatted;
|
||||||
}
|
}
|
||||||
|
|
||||||
function lFormatter(v, item) {
|
function lFormatter(v, item) {
|
||||||
return '<div style="font-size:'+font_size+'pt;">'+legend[v]+'</div>';
|
return '<span style="color:'+legend_color+'">'+legend[v]+'</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('#overview_' + graph_id).css('display', 'none');
|
||||||
|
|
||||||
if (menu) {
|
if (menu) {
|
||||||
var parent_height;
|
var parent_height;
|
||||||
$('#menu_overview_' + graph_id).click(function() {
|
$('#menu_overview_' + graph_id).click(function() {
|
||||||
$('#overview_' + graph_id).toggle();
|
$('#overview_' + graph_id).toggle();
|
||||||
/*
|
|
||||||
if($('#overview_' + graph_id).css('visibility') == 'visible'){
|
|
||||||
$('#overview_' + graph_id).css('visibility', 'hidden');
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$('#overview_' + graph_id).css('visibility', 'visible');
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#menu_export_csv_"+graph_id)
|
$("#menu_export_csv_"+graph_id)
|
||||||
|
@ -137,7 +137,7 @@ function flot_area_graph (
|
|||||||
$return = "<div class='parent_graph' style='width: " . ($params['width']) . ";" . $background_style . "'>";
|
$return = "<div class='parent_graph' style='width: " . ($params['width']) . ";" . $background_style . "'>";
|
||||||
// Set some containers to legend, graph, timestamp tooltip, etc.
|
// Set some containers to legend, graph, timestamp tooltip, etc.
|
||||||
if($params['show_legend']){
|
if($params['show_legend']){
|
||||||
$return .= "<p id='legend_$graph_id' class='legend_graph' style='font-size:" . $params['font_size'] ."pt !important;'></p>";
|
$return .= "<p id='legend_$graph_id' class='legend_graph' style='font-size:" . $params['font_size'] ."pt !important; color:" . $params['legend_color'] . " !important;'></p>";
|
||||||
}
|
}
|
||||||
if(isset($params['graph_combined']) && $params['graph_combined'] &&
|
if(isset($params['graph_combined']) && $params['graph_combined'] &&
|
||||||
(!isset($params['from_interface']) || !$params['from_interface']) ){
|
(!isset($params['from_interface']) || !$params['from_interface']) ){
|
||||||
@ -222,7 +222,7 @@ function flot_area_graph (
|
|||||||
|
|
||||||
if (!$vconsole){
|
if (!$vconsole){
|
||||||
$return .= "<div id='overview_$graph_id' class='overview_graph'
|
$return .= "<div id='overview_$graph_id' class='overview_graph'
|
||||||
style='margin:0px; margin-top:30px; margin-bottom:50px; display:none; width: ".$params['width']."; height: 200px;'></div>";
|
style='margin:0px; margin-top:30px; margin-bottom:50px; width: ".$params['width']."; height: 200px;'></div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($water_mark != '') {
|
if ($water_mark != '') {
|
||||||
|
@ -4629,13 +4629,11 @@ form ul.form_flex li ul li{
|
|||||||
border: 0px;
|
border: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
.yAxis.y1Axis > .tickLabel {
|
.yAxis.y1Axis > .tickLabel {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
line-height: 1.05em!important;
|
line-height: 1.05em!important;
|
||||||
width: auto!important;
|
width: auto!important;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
.pandora_confirm_dialog .ui-dialog-buttonset {
|
.pandora_confirm_dialog .ui-dialog-buttonset {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -384,6 +384,9 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
|
|||||||
$table->rowclass[] = '';
|
$table->rowclass[] = '';
|
||||||
|
|
||||||
$form_table = html_print_table($table, true);
|
$form_table = html_print_table($table, true);
|
||||||
|
$form_table .= '<div style="width:100%; text-align:right;">' .
|
||||||
|
html_print_submit_button(__('Reload'), "submit", false,
|
||||||
|
'class="sub upd"', true) . "</div>";
|
||||||
|
|
||||||
unset($table);
|
unset($table);
|
||||||
|
|
||||||
@ -400,14 +403,6 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
|
|||||||
$table->data[] = $data;
|
$table->data[] = $data;
|
||||||
$table->rowclass[] = '';
|
$table->rowclass[] = '';
|
||||||
|
|
||||||
$data = array();
|
|
||||||
$data[0] = '<div style="width:100%; text-align:right;">' .
|
|
||||||
html_print_submit_button(__('Reload'), "submit", false,
|
|
||||||
'class="sub upd"', true) .
|
|
||||||
"</div>";
|
|
||||||
$table->data[] = $data;
|
|
||||||
$table->rowclass[] = '';
|
|
||||||
|
|
||||||
$params['body_text'] .= html_print_table($table, true);
|
$params['body_text'] .= html_print_table($table, true);
|
||||||
$params['body_text'] .= '</form>';
|
$params['body_text'] .= '</form>';
|
||||||
$params['body_text'] .= '</div>'; // outer
|
$params['body_text'] .= '</div>'; // outer
|
||||||
|
@ -104,6 +104,7 @@ if ($view_graph) {
|
|||||||
$events = $graph["events"];
|
$events = $graph["events"];
|
||||||
$description = $graph["description"];
|
$description = $graph["description"];
|
||||||
$stacked = (int) get_parameter ('stacked', -1);
|
$stacked = (int) get_parameter ('stacked', -1);
|
||||||
|
|
||||||
$percentil = ($graph['percentil']) ? 1 : null;
|
$percentil = ($graph['percentil']) ? 1 : null;
|
||||||
$check = get_parameter('threshold',false);
|
$check = get_parameter('threshold',false);
|
||||||
$fullscale = ($graph['fullscale']) ? 1 : null;
|
$fullscale = ($graph['fullscale']) ? 1 : null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user