Trying to adjust graph render sizes

This commit is contained in:
fbsanchez 2018-06-19 19:19:38 +02:00
parent b625f2e5c8
commit 73567f1859
3 changed files with 13 additions and 4 deletions

View File

@ -96,9 +96,13 @@ if (file_exists ('languages/'.$user_language.'.mo')) {
$params['only_image'] = false;
$params['width'] = '1048';
$params['width'] = (int) $_REQUEST['viewport_width'];
$params['menu'] = false;
if((!isset($params['width']) || ($params['width'] <= 0)) {
$params['width'] = 1048;
}
$params_combined = json_decode($_REQUEST['data_combined'], true);
$module_list = json_decode($_REQUEST['data_module_list'], true);
$type_graph_pdf = $_REQUEST['type_graph_pdf'];

View File

@ -3252,11 +3252,14 @@ function generator_chart_to_pdf($type_graph_pdf, $params, $params_combined = fal
$result = exec($cmd);
if($params['return_img_base_64']){
// To be used in alerts
$width_img = 500;
return $result;
}
else{
// to be used in PDF files
$config["temp_images"][] = $img_path;
return '<img src="' . $img_url . '" />';
return '<img style="width: 100%;height: ' . $height_img . '" src="' . $img_url . '" />';
}
}

View File

@ -31,12 +31,14 @@ if(type_graph_pdf == 'combined'){
"&data_combined=" + url_params_comb +
"&data_module_list=" + url_module_list +
"&type_graph_pdf=" + type_graph_pdf +
"&session_id=" + session_id;
"&session_id=" + session_id +
"&viewport_width=" + viewport_width;
}
else{
post_data = "data=" + url_params +
"&type_graph_pdf=" + type_graph_pdf +
"&session_id=" + session_id;
"&session_id=" + session_id +
"&viewport_width=" + viewport_width;
}
page.viewportSize = { width: _width, height: _height };