ticket Integria: 4070 fixed visual console add custom graph #4070

This commit is contained in:
daniel 2016-09-27 12:16:14 +02:00
parent 112d57df5d
commit 33e7e40856
4 changed files with 17 additions and 13 deletions

View File

@ -1239,8 +1239,8 @@ function setModuleGraph(id_data) {
id_agente_modulo = data['id_agente_modulo']; id_agente_modulo = data['id_agente_modulo'];
id_custom_graph = data['id_custom_graph']; id_custom_graph = data['id_custom_graph'];
label = data['label']; label = data['label'];
height = data['height']; height = (data['height'] + 60);
width = data['width']; width = (data['width'] + 60);
period = data['period']; period = data['period'];
background_color = data['image']; background_color = data['image'];

View File

@ -153,7 +153,7 @@ switch ($action) {
if ($id_custom_graph != 0) { if ($id_custom_graph != 0) {
$img = custom_graphs_print( $img = custom_graphs_print(
$id_custom_graph, $height, $width, $period, $id_custom_graph, $height, $width, $period,
true, true, 0, true, $background_color); null, true, 0, true, $background_color);
} }
else { else {
$img = grafico_modulo_sparse($id_agent_module, $img = grafico_modulo_sparse($id_agent_module,
@ -189,7 +189,8 @@ switch ($action) {
case 'get_layout_data': case 'get_layout_data':
$layoutData = db_get_row_filter('tlayout_data', $layoutData = db_get_row_filter('tlayout_data',
array('id' => $id_element)); array('id' => $id_element));
$layoutData['height'] = $layoutData['height'] + 60;
$layoutData['width'] = $layoutData['width'] + 60;
echo json_encode($layoutData); echo json_encode($layoutData);
break; break;

View File

@ -94,8 +94,10 @@ function visual_map_print_item($mode = "read", $layoutData,
require_once ($config["homedir"] . '/include/functions_graph.php'); require_once ($config["homedir"] . '/include/functions_graph.php');
require_once ($config["homedir"] . '/include/functions_custom_graphs.php'); require_once ($config["homedir"] . '/include/functions_custom_graphs.php');
$width = $layoutData['width']; //add 60 px for visual console map
$height = $max_percentile = $layoutData['height']; $width = $layoutData['width'] + 60;
$height = $layoutData['height'] + 60;
$max_percentile = $layoutData['height'];
$top = $layoutData['pos_y']; $top = $layoutData['pos_y'];
$left = $layoutData['pos_x']; $left = $layoutData['pos_x'];
$id = $layoutData['id']; $id = $layoutData['id'];

View File

@ -691,7 +691,7 @@ function pch_bar_graph ($graph_type, $index, $data, $width, $height, $font,
"Mode"=>SCALE_MODE_START0, "LabelRotation" => 60); "Mode"=>SCALE_MODE_START0, "LabelRotation" => 60);
$margin_left = 40; $margin_left = 40;
$margin_top = 10; $margin_top = 10;
$margin_bottom = 10 * $max_chars; $margin_bottom = 3 * $max_chars;
break; break;
case "hbar": case "hbar":
$scaleSettings = array("GridR"=>200,"GridG"=>200,"GridB"=>200,"DrawSubTicks"=>TRUE, $scaleSettings = array("GridR"=>200,"GridG"=>200,"GridB"=>200,"DrawSubTicks"=>TRUE,
@ -718,13 +718,13 @@ function pch_bar_graph ($graph_type, $index, $data, $width, $height, $font,
$myPicture->setGraphArea($margin_left,$margin_top,$width - $water_mark_width,$height-$margin_bottom); $myPicture->setGraphArea($margin_left,$margin_top,$width - $water_mark_width,$height-$margin_bottom);
$myPicture->drawScale($scaleSettings); $myPicture->drawScale($scaleSettings);
/*
if (isset($legend)) { if (isset($legend)) {
/* Write the chart legend */ /* Write the chart legend
$size = $myPicture->getLegendSize(array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); $size = $myPicture->getLegendSize(array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL));
$myPicture->drawLegend($width-$size['Width'],0,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL, "BoxWidth"=>10, "BoxHeight"=>10)); $myPicture->drawLegend($width-$size['Width'],0,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL, "BoxWidth"=>10, "BoxHeight"=>10));
} }
*/
/* Turn on shadow computing */ /* Turn on shadow computing */
$myPicture->setShadow(TRUE,array("X"=>0,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); $myPicture->setShadow(TRUE,array("X"=>0,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10));
@ -1137,8 +1137,9 @@ function pch_bullet_chart($graph_type, $data, $legend,
$MyData->setSerieDescription("Labels", __("Agents/Modules")); $MyData->setSerieDescription("Labels", __("Agents/Modules"));
$height_t = ($height * count($data) ) + 40; $height_t = ($height * count($data) ) + 40;
$width_t = ($width + ( 200 + $max_chars)); $height_t = $height;
$max_chars = graph_get_max_index($legend_values); $max_chars = graph_get_max_index($legend);
$width_t = ($width + ( 100 + $max_chars));
/* Create the pChart object */ /* Create the pChart object */
$myPicture = new pImage($width_t, $height_t,$MyData); $myPicture = new pImage($width_t, $height_t,$MyData);
@ -1151,7 +1152,7 @@ function pch_bullet_chart($graph_type, $data, $legend,
$height_t - 10; $height_t - 10;
/* Draw the scale and chart */ /* Draw the scale and chart */
$myPicture->setGraphArea(220,20,($width + 80), $height_t); $myPicture->setGraphArea(250,20,($width + 100), $height_t);
$myPicture->drawScale(array("Pos"=>SCALE_POS_TOPBOTTOM, "Mode"=>SCALE_MODE_ADDALL_START0, $myPicture->drawScale(array("Pos"=>SCALE_POS_TOPBOTTOM, "Mode"=>SCALE_MODE_ADDALL_START0,
"LabelingMethod"=>LABELING_DIFFERENT, "GridR"=>255, "GridG"=>255, "LabelingMethod"=>LABELING_DIFFERENT, "GridR"=>255, "GridG"=>255,
"GridB"=>255, "GridAlpha"=>50, "TickR"=>0,"TickG"=>0, "TickB"=>0, "GridB"=>255, "GridAlpha"=>50, "TickR"=>0,"TickG"=>0, "TickB"=>0,