Merge branch 'ent-1577-vista-general-descuadrada-en-graph-containers' into 'develop'

Added resize functionality to flot graphs and fix overview in container graphs

See merge request artica/pandorafms!1068
This commit is contained in:
vgilc 2017-12-21 10:46:42 +01:00
commit 097bc3df32
2 changed files with 13 additions and 1 deletions

View File

@ -108,7 +108,7 @@ if($report_r && $report_w){
}
$('div[class *= bullet]').css('margin-left','0');
$('div[class *= graph]').css('margin-left','0');
$('div[class = graph]').css('margin-left','0');
$('div[id *= gauge_]').css('width','100%');
$('select[id *= period_container_'+hash+']').change(function() {

View File

@ -1607,6 +1607,12 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
// Adjust the overview plot to the width and position of the main plot
adjust_left_width_canvas(graph_id, 'overview_'+graph_id);
update_left_width_canvas(graph_id);
// Adjust overview when main chart is resized
$('#'+graph_id).resize(function(){
update_left_width_canvas(graph_id);
});
// Adjust linked graph to the width and position of the main plot
@ -2139,6 +2145,12 @@ function adjust_left_width_canvas(adapter_id, adapted_id) {
$('#'+adapted_id).css('margin-left', adapter_left_margin);
}
function update_left_width_canvas(graph_id) {
$('#overview_'+graph_id).width($('#'+graph_id).width() - 30);
$('#overview_'+graph_id).css('margin-left', $('#'+graph_id+' .yAxis .tickLabel').width());
}
function check_adaptions(graph_id) {
var classes = $('#'+graph_id).attr('class').split(' ');