Changed custom graph size specs in visual console

This commit is contained in:
Arturo Gonzalez 2017-05-26 12:55:37 +02:00
parent cca5f7d2ef
commit 54b70e5927
2 changed files with 27 additions and 40 deletions

View File

@ -898,47 +898,52 @@ function visual_map_print_item($mode = "read", $layoutData,
if ($width == 0 || $height == 0) { if ($width == 0 || $height == 0) {
if ($layoutData['label_position']=='left') { if ($layoutData['label_position']=='left') {
$img = '<div style="float:right;height:'.$himg.'px;">'.custom_graphs_print( $img = '<div style="float:right;height:'.$himg.'px;">'.custom_graphs_print(
$layoutData['id_custom_graph'], 180, 300, $layoutData['id_custom_graph'], 180, 480,
$period, null, true, 0, $only_image, $layoutData['image'], $period, null, true, 0, $only_image, $layoutData['image'],
array(), '', array(), array(), true, array(), '', array(), array(), true,
false, false, true, 1, false, true).'</div>'; false, false, true, 1, false, true).'</div>';
} }
elseif ($layoutData['label_position']=='right') { elseif ($layoutData['label_position']=='right') {
$img = '<div style="float:left;height:'.$himg.'px;">'.custom_graphs_print( $img = '<div style="float:left;height:'.$himg.'px;">'.custom_graphs_print(
$layoutData['id_custom_graph'], 180, 300, $layoutData['id_custom_graph'], 180, 480,
$period, null, true, 0, $only_image, $layoutData['image'], $period, null, true, 0, $only_image, $layoutData['image'],
array(), '', array(), array(), true, array(), '', array(), array(), true,
false, false, true, 1, false, true).'</div>'; false, false, true, 1, false, true).'</div>';
} }
else { else {
$img = custom_graphs_print( $img = custom_graphs_print(
$layoutData['id_custom_graph'], 180, 300, $layoutData['id_custom_graph'], 180, 480,
$period, null, true, 0, $only_image, $layoutData['image'], $period, null, true, 0, $only_image, $layoutData['image'],
array(), '', array(), array(), true, array(), '', array(), array(), true,
false, false, true, 1, false, true); false, false, true, 1, false, true);
} }
} }
else { else {
if ($layoutData['label_position']=='left') { if ($width < 480){
$img = '<div style="float:right;height:'.$himg.'px;">'.custom_graphs_print( $img = '<div class="error">'._("Could not draw pie with labels contained inside canvas. Resize widget to 500px width minimum").'</div>';
$layoutData['id_custom_graph'], $height, $width,
$period, null, true, 0, $only_image, $layoutData['image'],
array(), '', array(), array(), true,
false, false, true, 1, false, true).'</div>';
}
elseif($layoutData['label_position']=='right') {
$img = '<div style="float:left;height:'.$himg.'px;">'.custom_graphs_print(
$layoutData['id_custom_graph'], $height, $width,
$period, null, true, 0, $only_image, $layoutData['image'],
array(), '', array(), array(), true,
false, false, true, 1, false, true).'</div>';
} }
else { else {
$img = custom_graphs_print( if ($layoutData['label_position']=='left') {
$layoutData['id_custom_graph'], $height, $width, $img = '<div style="float:right;height:'.$himg.'px;">'.custom_graphs_print(
$period, null, true, 0, $only_image, $layoutData['image'], $layoutData['id_custom_graph'], $height, $width,
array(), '', array(), array(), true, $period, null, true, 0, $only_image, $layoutData['image'],
false, false, true, 1, false, true); array(), '', array(), array(), true,
false, false, true, 1, false, true).'</div>';
}
elseif($layoutData['label_position']=='right') {
$img = '<div style="float:left;height:'.$himg.'px;">'.custom_graphs_print(
$layoutData['id_custom_graph'], $height, $width,
$period, null, true, 0, $only_image, $layoutData['image'],
array(), '', array(), array(), true,
false, false, true, 1, false, true).'</div>';
}
else {
$img = custom_graphs_print(
$layoutData['id_custom_graph'], $height, $width,
$period, null, true, 0, $only_image, $layoutData['image'],
array(), '', array(), array(), true,
false, false, true, 1, false, true);
}
} }
} }
} }

View File

@ -254,7 +254,7 @@ $ignored_params['refr'] = '';
} }
startCountDown(refr, false); startCountDown(refr, false);
//~ // Auto hide controls
var controls = document.getElementById('vc-controls'); var controls = document.getElementById('vc-controls');
autoHideElement(controls, 1000); autoHideElement(controls, 1000);
@ -316,23 +316,5 @@ $ignored_params['refr'] = '';
$(this).css('height', height); $(this).css('height', height);
}); });
/*
$('.percentile_item a > img').each(function(){
if($(this).css('float')=='left' || $(this).css('float')=='right'){
$(this).css('margin-top',(parseInt($(this).parent().parent().css('height'))/2-parseInt($(this).css('height'))/2)+'px');
$(this).css('margin-left','');
}
else{
$(this).css('margin-left',(parseInt($(this).parent().parent().css('width'))/2-parseInt($(this).css('width'))/2)+'px');
$(this).css('margin-top','');
}
});
*/
}); });
</script> </script>