diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 5cb934ab10..775ae4f609 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2010-10-25 Ramon Novoa + + * include/pchart_graph.php, include/fgraph.php: Added baseline support + to image charts (Enterprise). + 2010-10-25 Raúl Mateos * images/control*.png: Added two small images for sound control in setup. diff --git a/pandora_console/include/fgraph.php b/pandora_console/include/fgraph.php index 2a02d48d23..089a613d99 100644 --- a/pandora_console/include/fgraph.php +++ b/pandora_console/include/fgraph.php @@ -1556,7 +1556,7 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events, } $engine->fontpath = $config['fontpath']; - $engine->sparse_graph ($period, $avg_only, $min_value, $max_value, $unit_name); + $engine->sparse_graph ($period, $avg_only, $min_value, $max_value, $unit_name, $baseline); } function grafico_modulo_sparse_mobile ($agent_module_id, $period, $show_events, diff --git a/pandora_console/include/pchart_graph.php b/pandora_console/include/pchart_graph.php index a44791f661..991c7d4993 100644 --- a/pandora_console/include/pchart_graph.php +++ b/pandora_console/include/pchart_graph.php @@ -165,7 +165,7 @@ class PchartGraph extends PandoraGraphAbstract { $this->graph->Stroke (); } - public function sparse_graph ($period, $avg_only, $min_value, $max_value, $unit_name) { + public function sparse_graph ($period, $avg_only, $min_value, $max_value, $unit_name, $baseline = 0) { // Dataset definition $this->dataset = new pData; $this->graph = new pChart ($this->width, $this->height+5); @@ -192,6 +192,14 @@ class PchartGraph extends PandoraGraphAbstract { $this->dataset->SetSerieName (__("Max"), "MAX"); $this->set_colors (); } + + // Draw baseline + if ($baseline == 1) { + foreach ($this->data as $data) { + $this->dataset->AddPoint ($data['baseline'], "BLINE"); + } + } + $this->dataset->SetXAxisFormat ('datetime'); $this->graph->setDateFormat ("Y"); $this->dataset->SetYAxisFormat ('metric');