';
- $output .= draw_container_chart_stat_win('tabs-chart-module-graph');
+ $output = '
';
+ $output .= '
';
+ $output .= draw_container_chart_stat_win($graph_tab);
$output .= '
';
-
- $output .= '
';
- $output .= draw_container_chart_stat_win('tabs-chart-period-graph');
- $output .= '
';
-
$output .= '
';
} else {
// Graph.
@@ -408,18 +378,8 @@ ui_include_time_picker(true);
var histogram = "";
var period_graph = "";
if(histogram == 0) {
- $("#tabs-chart-modal").tabs({
- create: function( event, ui ) {
- var tab_active = ui.tab.children(":first").attr('id');
- get_ajax_module(url, graph_data, form_data, serverId, tab_active);
- },
- activate: function( event, ui ) {
- var tab_active = ui.newTab.children(":first").attr('id');
- change_tabs_periodicity(tab_active);
- get_ajax_module(url, graph_data, form_data, serverId, tab_active);
- },
- active: period_graph
- });
+ var tab_active = '';
+ get_ajax_module(url, graph_data, form_data, serverId, tab_active);
} else {
get_ajax_module(url, graph_data, form_data, serverId, null);
}
@@ -443,7 +403,7 @@ ui_include_time_picker(true);
function get_ajax_module(url, graph_data, form_data, serverId, id) {
let active = 'stat-win-module-graph';
if(id != null) {
- active = $("#"+id).parent().attr('aria-controls');
+ active = id;
}
$("#tabs-chart-module-graph-content").empty();
$("#tabs-chart-period-graph-content").empty();
@@ -463,6 +423,20 @@ ui_include_time_picker(true);
success: function (data) {
$("#"+active+"-spinner").hide();
$("#"+active+"-content").append(data);
+ if (active === 'tabs-chart-module-graph' || active === 'tabs-chart-period-graph') {
+ let margin = 100;
+ if (navigator.userAgent.indexOf("Chrome") != -1) {
+ margin = 100;
+ } else if (navigator.userAgent.indexOf("Firefox") != -1) {
+ margin = 50;
+ }
+
+ var browserZoomLevel = (Math.round(window.devicePixelRatio * 100)/100);
+ let height = ($('#chart-modal').height() + margin) * browserZoomLevel;
+ let width = 800 * browserZoomLevel;
+ window.resizeTo(width, height);
+ }
+
let pg = 0;
if (active === 'tabs-chart-period-graph') {
pg = 1;