mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Work around jpgraph bug (#11425)
apparently GD now returns false when getting the bounding box of empty strings, this causes jpgraph to throw an incorrect error. Work around that by setting all possible text to a single space character.
This commit is contained in:
@@ -63,6 +63,14 @@ function YCallback($y)
|
||||
$graph = new Graph($vars['width'], $vars['height'], $graph_data['graph_name']);
|
||||
$graph->img->SetImgFormat('png');
|
||||
|
||||
// work around bug in jpgraph error handling
|
||||
$graph->title->Set(' ');
|
||||
$graph->subtitle->Set(' ');
|
||||
$graph->subsubtitle->Set(' ');
|
||||
$graph->footer->left->Set(' ');
|
||||
$graph->footer->center->Set(' ');
|
||||
$graph->footer->right->Set(' ');
|
||||
|
||||
$graph->SetScale('datlin', 0, 0, $graph_data['from'], $graph_data['to']);
|
||||
$graph->SetMarginColor('white');
|
||||
$graph->SetFrame(false);
|
||||
|
@@ -27,6 +27,14 @@ for ($i = 0; $i < count($graph_data['ticklabels']); $i++) {
|
||||
$graph = new Graph($vars['width'], $vars['height'], $graph_data['graph_name']);
|
||||
$graph->img->SetImgFormat('png');
|
||||
|
||||
// work around bug in jpgraph error handling
|
||||
$graph->title->Set(' ');
|
||||
$graph->subtitle->Set(' ');
|
||||
$graph->subsubtitle->Set(' ');
|
||||
$graph->footer->left->Set(' ');
|
||||
$graph->footer->center->Set(' ');
|
||||
$graph->footer->right->Set(' ');
|
||||
|
||||
$graph->SetScale('textlin');
|
||||
// $graph->title->Set("$graph_name");
|
||||
$graph->title->SetFont(FF_FONT2, FS_BOLD, 10);
|
||||
|
@@ -29,6 +29,14 @@ for ($i = 0; $i < count($graph_data['ticklabels']); $i++) {
|
||||
$graph = new Graph($vars['width'], $vars['height'], $graph_data['graph_name']);
|
||||
$graph->img->SetImgFormat('png');
|
||||
|
||||
// work around bug in jpgraph error handling
|
||||
$graph->title->Set(' ');
|
||||
$graph->subtitle->Set(' ');
|
||||
$graph->subsubtitle->Set(' ');
|
||||
$graph->footer->left->Set(' ');
|
||||
$graph->footer->center->Set(' ');
|
||||
$graph->footer->right->Set(' ');
|
||||
|
||||
$graph->SetScale('textlin');
|
||||
$graph->title->SetFont(FF_FONT2, FS_BOLD, 10);
|
||||
$graph->SetMarginColor('white');
|
||||
|
Reference in New Issue
Block a user