2010-10-25 Ramon Novoa <rnovoa@artica.es>
* include/pchart_graph.php, include/fgraph.php: Added baseline support to image charts (Enterprise). git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3456 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
f43f25cf7b
commit
db208e67a4
|
@ -1,3 +1,8 @@
|
|||
2010-10-25 Ramon Novoa <rnovoa@artica.es>
|
||||
|
||||
* include/pchart_graph.php, include/fgraph.php: Added baseline support
|
||||
to image charts (Enterprise).
|
||||
|
||||
2010-10-25 Raúl Mateos <raulofpandora@gmail.com>
|
||||
|
||||
* images/control*.png: Added two small images for sound control in setup.
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Reference in New Issue