mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Merge branch '1804-Imagen-para-no-data' into 'develop'
Added text for nodata in graph and resized image - #1804 See merge request artica/pandorafms!1838
This commit is contained in:
commit
f53dbea234
@ -912,7 +912,9 @@ function grafico_modulo_sparse ($params) {
|
|||||||
else{
|
else{
|
||||||
$return = graph_nodata_image(
|
$return = graph_nodata_image(
|
||||||
$params['width'],
|
$params['width'],
|
||||||
$params['height']
|
$params['height'],
|
||||||
|
'area',
|
||||||
|
__('No data to display within the selected interval')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4070,19 +4072,17 @@ function graphic_module_events ($id_module, $width, $height, $period = 0, $homeu
|
|||||||
}
|
}
|
||||||
|
|
||||||
function graph_nodata_image($width = 300, $height = 110, $type = 'area', $text = '') {
|
function graph_nodata_image($width = 300, $height = 110, $type = 'area', $text = '') {
|
||||||
$image = ui_get_full_url('images/image_problem_area_small.png',
|
$image = ui_get_full_url('images/image_problem_area.png',
|
||||||
false, false, false);
|
false, false, false);
|
||||||
|
|
||||||
// if ($text == '') {
|
// if ($text == '') {
|
||||||
// $text = __('No data to show');
|
// $text = __('No data to show');
|
||||||
// }
|
// }
|
||||||
|
$text_div = '<div class="nodata_text" style="text-align:center; padding: 30px 0; display:block; font-size:9.5pt;">' . $text . '</div>';
|
||||||
|
|
||||||
$text_div = '<div class="nodata_text">' . $text . '</div>';
|
$image_div = $text_div . '<div class="nodata_container" style="background-position: top; width:40%;height:40%;background-size: contain;background-image: url(\'' . $image . '\');"><div></div></div>';
|
||||||
|
|
||||||
$image_div = '<div class="nodata_container" style="width:80%;height:80%;background-size: 80% 80%;background-image: url(\'' . $image . '\');">' .
|
$div = '<div style="width:' . $width . 'px; height:' . $height . 'px; background-color: white; margin: 0 auto;">' .
|
||||||
$text_div . '</div>';
|
|
||||||
|
|
||||||
$div = '<div style="width:' . $width . 'px; height:' . $height . 'px; border: 1px dotted #ddd; background-color: white; margin: 0 auto;">' .
|
|
||||||
$image_div . '</div>';
|
$image_div . '</div>';
|
||||||
|
|
||||||
return $div;
|
return $div;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user