Fixed resulution charts

This commit is contained in:
daniel 2020-02-27 10:52:01 +01:00 committed by Daniel Rodriguez
parent a9590892bf
commit ac6ca52c45
3 changed files with 8 additions and 25 deletions

View File

@ -169,7 +169,7 @@ if (file_exists('languages/'.$user_language.'.mo') === true) {
$module_list = json_decode($_REQUEST['data_module_list'], true);
$type_graph_pdf = $_REQUEST['type_graph_pdf'];
if ($params['vconsole'] === false) {
if (isset($params['vconsole']) === false || $params['vconsole'] === false) {
$params['width'] = (int) $_REQUEST['viewport_width'];
if ((isset($params['width']) === false
|| ($params['width'] <= 0))
@ -180,7 +180,7 @@ if (file_exists('languages/'.$user_language.'.mo') === true) {
}
if ($type_graph_pdf === 'slicebar') {
$params['width'] = 150;
$params['width'] = 100;
$params['height'] = 70;
}
}

View File

@ -3870,23 +3870,12 @@ function generator_chart_to_pdf($type_graph_pdf, $params, $params_combined=false
$img_url = ui_get_full_url(false).$hack_metaconsole.'/attachment/'.$img_file;
}
$width_img = 500;
$width_img = 550;
$height_img = $params['height'];
if ($params['vconsole'] === false) {
// Set height image.
$height_img = 170;
$params['height'] = 170;
if ((int) $params['landscape'] === 1) {
$height_img = 150;
$params['height'] = 150;
}
if ($type_graph_pdf === 'slicebar') {
$width_img = 360;
$height_img = 70;
}
} else {
$height_img = $params['height'];
if ((int) $params['landscape'] === 1) {
$height_img = 150;
$params['height'] = 150;
}
$params_encode_json = urlencode(json_encode($params));

View File

@ -3473,7 +3473,7 @@ function reporting_html_availability_graph($table, $item, $pdf=0)
}
// Check failover availability report.
if ($item['data'][$k_chart]['failover'] === '') {
if (empty($item['data'][$k_chart]['failover']) === true) {
$table1 = new stdClass();
$table1->width = '100%';
$table1->data = [];
@ -3482,12 +3482,6 @@ function reporting_html_availability_graph($table, $item, $pdf=0)
$table1->size[1] = '80%';
$table1->size[2] = '5%';
$table1->size[3] = '5%';
if ($pdf !== 0) {
$table1->size[0] = '20%';
$table1->size[1] = '60%';
$table1->size[2] = '10%';
$table1->size[3] = '10%';
}
$table1->data[0][0] = $chart['agent'].'<br />'.$chart['module'];
$table1->data[0][1] = $chart['chart'];