mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 07:44:35 +02:00
2011-04-20 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_graph.php, include/graphs/functions_pchart.php: some fixes, and set font size equal for all text in graphs. And starte the change to vertical bar the graph for string module. * include/functions_reporting.php: added to take the font and size. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4273 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
4acde1638a
commit
5efec44fef
@ -1,3 +1,12 @@
|
|||||||
|
2011-04-20 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* include/functions_graph.php,
|
||||||
|
include/graphs/functions_pchart.php: some fixes, and set font size equal
|
||||||
|
for all text in graphs. And starte the change to vertical bar the graph
|
||||||
|
for string module.
|
||||||
|
|
||||||
|
* include/functions_reporting.php: added to take the font and size.
|
||||||
|
|
||||||
2011-04-20 Ramon Novoa <rnovoa@artica.es>
|
2011-04-20 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
* include/help/en/help_alert_macros.php,
|
* include/help/en/help_alert_macros.php,
|
||||||
|
@ -635,7 +635,7 @@ function graphic_combined_module2 ($module_list, $weight_list, $period, $width,
|
|||||||
if ($only_image) {
|
if ($only_image) {
|
||||||
$flash_charts = false;
|
$flash_charts = false;
|
||||||
}
|
}
|
||||||
$flash_charts = false;
|
|
||||||
switch ($stacked) {
|
switch ($stacked) {
|
||||||
case GRAPH_AREA:
|
case GRAPH_AREA:
|
||||||
$color = null;
|
$color = null;
|
||||||
@ -1484,7 +1484,7 @@ function grafico_modulo_boolean2 ($agent_module_id, $period, $show_events,
|
|||||||
|
|
||||||
// Get event data (contains alert data too)
|
// Get event data (contains alert data too)
|
||||||
if ($show_events == 1 || $show_alerts == 1) {
|
if ($show_events == 1 || $show_alerts == 1) {
|
||||||
$events = get_db_all_rows_filter ('tevento',
|
$events = db_get_all_rows_filter('tevento',
|
||||||
array ('id_agentmodule' => $agent_module_id,
|
array ('id_agentmodule' => $agent_module_id,
|
||||||
"utimestamp > $datelimit",
|
"utimestamp > $datelimit",
|
||||||
"utimestamp < $date",
|
"utimestamp < $date",
|
||||||
@ -1496,7 +1496,7 @@ function grafico_modulo_boolean2 ($agent_module_id, $period, $show_events,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get module data
|
// Get module data
|
||||||
$data = get_db_all_rows_filter ('tagente_datos',
|
$data = db_get_all_rows_filter ('tagente_datos',
|
||||||
array ('id_agente_modulo' => $agent_module_id,
|
array ('id_agente_modulo' => $agent_module_id,
|
||||||
"utimestamp > $datelimit",
|
"utimestamp > $datelimit",
|
||||||
"utimestamp < $date",
|
"utimestamp < $date",
|
||||||
@ -1798,7 +1798,7 @@ function grafico_modulo_string2 ($agent_module_id, $period, $show_events,
|
|||||||
|
|
||||||
// Get event data (contains alert data too)
|
// Get event data (contains alert data too)
|
||||||
if ($show_events == 1 || $show_alerts == 1) {
|
if ($show_events == 1 || $show_alerts == 1) {
|
||||||
$events = get_db_all_rows_filter ('tevento',
|
$events = db_get_all_rows_filter ('tevento',
|
||||||
array ('id_agentmodule' => $agent_module_id,
|
array ('id_agentmodule' => $agent_module_id,
|
||||||
"utimestamp > $datelimit",
|
"utimestamp > $datelimit",
|
||||||
"utimestamp < $date",
|
"utimestamp < $date",
|
||||||
@ -1810,7 +1810,7 @@ function grafico_modulo_string2 ($agent_module_id, $period, $show_events,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get module data
|
// Get module data
|
||||||
$data = get_db_all_rows_filter ('tagente_datos_string',
|
$data = db_get_all_rows_filter ('tagente_datos_string',
|
||||||
array ('id_agente_modulo' => $agent_module_id,
|
array ('id_agente_modulo' => $agent_module_id,
|
||||||
"utimestamp > $datelimit",
|
"utimestamp > $datelimit",
|
||||||
"utimestamp < $date",
|
"utimestamp < $date",
|
||||||
@ -1963,12 +1963,8 @@ function grafico_modulo_string2 ($agent_module_id, $period, $show_events,
|
|||||||
/////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////
|
||||||
$color = array();
|
$color = array();
|
||||||
$color['sum'] = array('border' => '#000000', 'color' => $config['graph_color2'], 'alpha' => 50);
|
$color['sum'] = array('border' => '#000000', 'color' => $config['graph_color2'], 'alpha' => 50);
|
||||||
if($show_events) {
|
$color['event'] = array('border' => '#ff7f00', 'color' => '#ff7f00', 'alpha' => 50);
|
||||||
$color['event'] = array('border' => '#ff7f00', 'color' => '#ff7f00', 'alpha' => 50);
|
$color['alert'] = array('border' => '#ff0000', 'color' => '#ff0000', 'alpha' => 50);
|
||||||
}
|
|
||||||
if($show_alerts) {
|
|
||||||
$color['alert'] = array('border' => '#ff0000', 'color' => '#ff0000', 'alpha' => 50);
|
|
||||||
}
|
|
||||||
$color['max'] = array('border' => '#000000', 'color' => $config['graph_color3'], 'alpha' => 50);
|
$color['max'] = array('border' => '#000000', 'color' => $config['graph_color3'], 'alpha' => 50);
|
||||||
$color['min'] = array('border' => '#000000', 'color' => $config['graph_color1'], 'alpha' => 50);
|
$color['min'] = array('border' => '#000000', 'color' => $config['graph_color1'], 'alpha' => 50);
|
||||||
//$color['baseline'] = array('border' => null, 'color' => '#0097BD', 'alpha' => 10);
|
//$color['baseline'] = array('border' => null, 'color' => '#0097BD', 'alpha' => 10);
|
||||||
@ -1981,6 +1977,14 @@ function grafico_modulo_string2 ($agent_module_id, $period, $show_events,
|
|||||||
|
|
||||||
$legend = null;
|
$legend = null;
|
||||||
|
|
||||||
|
//TODO FIX
|
||||||
|
|
||||||
|
return vbar_graph($flash_chart, $chart, $width, $height, $color,
|
||||||
|
$legend, "", "", $homeurl,
|
||||||
|
$config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
|
$config['fontpath'], $config['font_size']);
|
||||||
|
|
||||||
|
//old
|
||||||
return area_graph($flash_chart, $chart, $width, $height, $color, $legend,
|
return area_graph($flash_chart, $chart, $width, $height, $color, $legend,
|
||||||
$long_index, "images/image_problem.opaque.png", "", "", $homeurl,
|
$long_index, "images/image_problem.opaque.png", "", "", $homeurl,
|
||||||
$config['homedir'] . "/images/logo_vertical_water.png",
|
$config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
|
@ -1203,7 +1203,9 @@ function alert_reporting ($id_group, $period = 0, $date = 0, $return = false) {
|
|||||||
$data[__('Alerts fired')] = $fired_percentage;
|
$data[__('Alerts fired')] = $fired_percentage;
|
||||||
$data[__('Alerts not fired')] = $not_fired_percentage;
|
$data[__('Alerts not fired')] = $not_fired_percentage;
|
||||||
|
|
||||||
$output .= pie3d_graph($config['flash_charts'], $data, 280, 150);
|
$output .= pie3d_graph($config['flash_charts'], $data, 280, 150,
|
||||||
|
__("other"), "", $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
|
$config['fontpath'], $config['font_size']);
|
||||||
|
|
||||||
$output .= '<strong>'.__('Alerts fired').': '.sizeof ($alerts_fired).'</strong><br />';
|
$output .= '<strong>'.__('Alerts fired').': '.sizeof ($alerts_fired).'</strong><br />';
|
||||||
$output .= '<strong>'.__('Total alerts monitored').': '.sizeof ($alerts).'</strong><br />';
|
$output .= '<strong>'.__('Total alerts monitored').': '.sizeof ($alerts).'</strong><br />';
|
||||||
@ -1275,7 +1277,9 @@ function monitor_health_reporting ($id_group, $period = 0, $date = 0, $return =
|
|||||||
$data[__('Monitors OK')] = $down_percentage;
|
$data[__('Monitors OK')] = $down_percentage;
|
||||||
$data[__('Monitors BAD')] = $not_down_percentage;
|
$data[__('Monitors BAD')] = $not_down_percentage;
|
||||||
|
|
||||||
$output .= pie3d_graph($config['flash_charts'], $data, 280, 150);
|
$output .= pie3d_graph($config['flash_charts'], $data, 280, 150,
|
||||||
|
__("other"), "", $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
|
$config['fontpath'], $config['font_size']);
|
||||||
|
|
||||||
if (!$return)
|
if (!$return)
|
||||||
echo $output;
|
echo $output;
|
||||||
@ -2125,7 +2129,8 @@ function render_report_html_item ($content, $table, $report, $mini = false) {
|
|||||||
$data_pie_graph = json_encode ($data_graph);
|
$data_pie_graph = json_encode ($data_graph);
|
||||||
if (($show_graph == 1 || $show_graph == 2) && !empty($slas)) {
|
if (($show_graph == 1 || $show_graph == 2) && !empty($slas)) {
|
||||||
$data[0] = pie3d_graph($config['flash_charts'], $data_graph,
|
$data[0] = pie3d_graph($config['flash_charts'], $data_graph,
|
||||||
500, 150, __("other"));
|
500, 150, __("other"), "", $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
|
$config['fontpath'], $config['font_size']);
|
||||||
array_push ($table->data, $data);
|
array_push ($table->data, $data);
|
||||||
|
|
||||||
//Display horizontal bar graphs
|
//Display horizontal bar graphs
|
||||||
@ -3080,7 +3085,8 @@ function render_report_html_item ($content, $table, $report, $mini = false) {
|
|||||||
$data = array();
|
$data = array();
|
||||||
if ($show_graph == 1 || $show_graph == 2) {
|
if ($show_graph == 1 || $show_graph == 2) {
|
||||||
$data[0] = pie3d_graph($config['flash_charts'], $data_pie_graph,
|
$data[0] = pie3d_graph($config['flash_charts'], $data_pie_graph,
|
||||||
600, 150, __("other"));
|
600, 150, __("other"),"", $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
|
$config['fontpath'], $config['font_size']);
|
||||||
|
|
||||||
array_push ($table->data, $data);
|
array_push ($table->data, $data);
|
||||||
//Display bars graph
|
//Display bars graph
|
||||||
@ -3328,7 +3334,8 @@ function render_report_html_item ($content, $table, $report, $mini = false) {
|
|||||||
$data = array();
|
$data = array();
|
||||||
if ($show_graph == 1 || $show_graph == 2) {
|
if ($show_graph == 1 || $show_graph == 2) {
|
||||||
$data[0] = pie3d_graph($config['flash_charts'], $data_graph,
|
$data[0] = pie3d_graph($config['flash_charts'], $data_graph,
|
||||||
600, 150, __("other"));
|
600, 150, __("other"), "", $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
|
$config['fontpath'], $config['font_size']);
|
||||||
array_push ($table->data, $data);
|
array_push ($table->data, $data);
|
||||||
//Display bars graph
|
//Display bars graph
|
||||||
$table->colspan[4][0] = 3;
|
$table->colspan[4][0] = 3;
|
||||||
|
@ -452,12 +452,12 @@ function pch_kiviat_graph ($graph_type, $data_values, $legend_values, $width,
|
|||||||
"LabelMiddle"=>FALSE,"Layout"=>RADAR_LAYOUT_STAR,
|
"LabelMiddle"=>FALSE,"Layout"=>RADAR_LAYOUT_STAR,
|
||||||
"BackgroundGradient"=>array("StartR"=>255,"StartG"=>255,"StartB"=>255,
|
"BackgroundGradient"=>array("StartR"=>255,"StartG"=>255,"StartB"=>255,
|
||||||
"StartAlpha"=>100,"EndR"=>207,"EndG"=>227,"EndB"=>125,"EndAlpha"=>50),
|
"StartAlpha"=>100,"EndR"=>207,"EndG"=>227,"EndB"=>125,"EndAlpha"=>50),
|
||||||
"FontName"=>$font,"FontSize"=>$font_size / 1.8);
|
"FontName"=>$font,"FontSize"=>$font_size);
|
||||||
$SplitChart->drawRadar($myPicture,$MyData,$Options);
|
$SplitChart->drawRadar($myPicture,$MyData,$Options);
|
||||||
break;
|
break;
|
||||||
case "polar":
|
case "polar":
|
||||||
$Options = array("Layout"=>RADAR_LAYOUT_CIRCLE,"BackgroundGradient"=>array("StartR"=>255,"StartG"=>255,"StartB"=>255,"StartAlpha"=>100,"EndR"=>207,"EndG"=>227,"EndB"=>125,"EndAlpha"=>50),
|
$Options = array("Layout"=>RADAR_LAYOUT_CIRCLE,"BackgroundGradient"=>array("StartR"=>255,"StartG"=>255,"StartB"=>255,"StartAlpha"=>100,"EndR"=>207,"EndG"=>227,"EndB"=>125,"EndAlpha"=>50),
|
||||||
"FontName"=>$font,"FontSize"=>$font_size / 1.8);
|
"FontName"=>$font,"FontSize"=>$font_size);
|
||||||
$SplitChart->drawRadar($myPicture,$MyData,$Options);
|
$SplitChart->drawRadar($myPicture,$MyData,$Options);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -796,14 +796,14 @@ function pch_threshold_graph ($graph_type, $index, $data, $width, $height, $font
|
|||||||
|
|
||||||
/* Write the picture title */
|
/* Write the picture title */
|
||||||
$myPicture->setFontProperties(array("FontName"=>$font,"FontSize"=>$font_size));
|
$myPicture->setFontProperties(array("FontName"=>$font,"FontSize"=>$font_size));
|
||||||
$myPicture->drawText(60,35,$title,array("FontSize"=>($font_size * 1.8),"Align"=>TEXT_ALIGN_BOTTOMLEFT));
|
$myPicture->drawText(60,35,$title,array("FontSize"=>$font_size,"Align"=>TEXT_ALIGN_BOTTOMLEFT));
|
||||||
|
|
||||||
/* Do some cosmetic and draw the chart */
|
/* Do some cosmetic and draw the chart */
|
||||||
$myPicture->setGraphArea(60,40,670,190);
|
$myPicture->setGraphArea(60,40,670,190);
|
||||||
$myPicture->drawFilledRectangle(60,40,670,190,array("R"=>255,"G"=>255,"B"=>255,"Surrounding"=>-200,"Alpha"=>10));
|
$myPicture->drawFilledRectangle(60,40,670,190,array("R"=>255,"G"=>255,"B"=>255,"Surrounding"=>-200,"Alpha"=>10));
|
||||||
$myPicture->drawScale(array("GridR"=>180,"GridG"=>180,"GridB"=>180, "Mode" => SCALE_MODE_START0));
|
$myPicture->drawScale(array("GridR"=>180,"GridG"=>180,"GridB"=>180, "Mode" => SCALE_MODE_START0));
|
||||||
$myPicture->setShadow(TRUE,array("X"=>2,"Y"=>2,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10));
|
$myPicture->setShadow(TRUE,array("X"=>2,"Y"=>2,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10));
|
||||||
$myPicture->setFontProperties(array("FontName"=>$font,"FontSize"=>($font_size / 1.8)));
|
$myPicture->setFontProperties(array("FontName"=>$font,"FontSize"=>$font_size));
|
||||||
$settings = array("Gradient"=>TRUE,"GradientMode"=>GRADIENT_EFFECT_CAN,"DisplayValues"=>$show_values,"DisplayZeroValues"=>FALSE,"DisplayR"=>100,"DisplayG"=>100,"DisplayB"=>100,"DisplayShadow"=>TRUE,"Surrounding"=>5,"AroundZero"=>FALSE);
|
$settings = array("Gradient"=>TRUE,"GradientMode"=>GRADIENT_EFFECT_CAN,"DisplayValues"=>$show_values,"DisplayZeroValues"=>FALSE,"DisplayR"=>100,"DisplayG"=>100,"DisplayB"=>100,"DisplayShadow"=>TRUE,"Surrounding"=>5,"AroundZero"=>FALSE);
|
||||||
$myPicture->drawSplineChart($settings);
|
$myPicture->drawSplineChart($settings);
|
||||||
$myPicture->setShadow(FALSE);
|
$myPicture->setShadow(FALSE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user