Fixed minor error graph sparse width

This commit is contained in:
daniel 2020-06-25 15:18:33 +02:00 committed by Daniel Rodriguez
parent a645f3c0b2
commit 7dc759f3ac
1 changed files with 7 additions and 1 deletions

View File

@ -139,7 +139,13 @@ function flot_area_graph(
}
// Parent layer.
$return = "<div class='parent_graph' style='width: ".$params['width'].'px;'.$background_style."'>";
if (strpos($params['width'], '%') === false) {
$width = 'width: '.$params['width'].'px;';
} else {
$width = 'width: '.$params['width'].';';
}
$return = "<div class='parent_graph' style='".$width.$background_style."'>";
if ($params['title'] === true && empty($params['title']) === false) {
$return .= '<p style="text-align:center;">'.$params['title'].'</p>';