Y axis fixed in custom graphs, now show correctly the numeration. Ticket#2578

This commit is contained in:
Arturo Gonzalez Diaz 2015-08-24 13:14:48 +02:00
parent 274d0c524f
commit 596a20b19d
4 changed files with 5033 additions and 5027 deletions

View File

@ -1444,8 +1444,8 @@ function graphic_combined_module ($module_list, $weight_list, $period,
$height, $color, $module_name_list, $long_index, $height, $color, $module_name_list, $long_index,
ui_get_full_url("images/image_problem.opaque.png", false, false, false), ui_get_full_url("images/image_problem.opaque.png", false, false, false),
"", "", $homeurl, $water_mark, $config['fontpath'], "", "", $homeurl, $water_mark, $config['fontpath'],
$fixed_font_size, "", $ttl, array(), array(), 0, 0, '', $fixed_font_size, $unit, $ttl, array(), array(), 0, 0, '',
false, '', true, $background_color); false, '', true, $background_color);
break; break;
default: default:
case CUSTOM_GRAPH_STACKED_AREA: case CUSTOM_GRAPH_STACKED_AREA:

View File

@ -265,7 +265,8 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color,
$graph['font'] = $font; $graph['font'] = $font;
$graph['font_size'] = $font_size; $graph['font_size'] = $font_size;
$graph['backgroundColor'] = $backgroundColor; $graph['backgroundColor'] = $backgroundColor;
$graph['unit'] = $unit;
$id_graph = serialize_in_temp($graph, null, $ttl); $id_graph = serialize_in_temp($graph, null, $ttl);
// Warning: This string is used in the function "api_get_module_graph" from 'functions_api.php' with the regec patern "/<img src='(.+)'>/" // Warning: This string is used in the function "api_get_module_graph" from 'functions_api.php' with the regec patern "/<img src='(.+)'>/"

View File

@ -111,6 +111,9 @@ if (isset($graph['force_height'])) {
if (isset($graph['period'])) { if (isset($graph['period'])) {
$period = $graph['period']; $period = $graph['period'];
} }
if (isset($graph['unit'])){
$unit = $graph['unit'];
}
if (!$force_height) { if (!$force_height) {
if ($height < (count($graph['data']) * 14)) { if ($height < (count($graph['data']) * 14)) {
@ -301,7 +304,7 @@ switch($graph_type) {
case 'line': case 'line':
pch_vertical_graph($graph_type, $data_keys, $data_values, $width, pch_vertical_graph($graph_type, $data_keys, $data_values, $width,
$height, $rgb_color, $xaxisname, $yaxisname, false, $legend, $height, $rgb_color, $xaxisname, $yaxisname, false, $legend,
$font, $antialiasing, $water_mark, $font_size, $backgroundColor); $font, $antialiasing, $water_mark, $font_size, $backgroundColor, $unit);
break; break;
case 'threshold': case 'threshold':
pch_threshold_graph($graph_type, $data_keys, $data_values, $width, pch_threshold_graph($graph_type, $data_keys, $data_values, $width,
@ -618,9 +621,9 @@ function pch_bar_graph ($graph_type, $index, $data, $width, $height, $font,
function pch_vertical_graph ($graph_type, $index, $data, $width, $height, function pch_vertical_graph ($graph_type, $index, $data, $width, $height,
$rgb_color = false, $xaxisname = "", $yaxisname = "", $show_values = false, $rgb_color = false, $xaxisname = "", $yaxisname = "", $show_values = false,
$legend = array(), $font, $antialiasing, $water_mark = '', $font_size, $legend = array(), $font, $antialiasing, $water_mark = '', $font_size,
$backgroundColor = 'white') { $backgroundColor = 'white', $unit = '') {
/* CAT:Vertical Charts */ /* CAT:Vertical Charts */
if (!is_array($legend) || empty($legend)) { if (!is_array($legend) || empty($legend)) {
unset($legend); unset($legend);
@ -692,7 +695,9 @@ function pch_vertical_graph ($graph_type, $index, $data, $width, $height,
$MyData->addPoints($index,"Xaxis"); $MyData->addPoints($index,"Xaxis");
$MyData->setSerieDescription("Xaxis", $xaxisname); $MyData->setSerieDescription("Xaxis", $xaxisname);
$MyData->setAbscissa("Xaxis"); $MyData->setAbscissa("Xaxis");
$MyData->setAxisUnit(0, $unit);
$MyData->setAxisDisplay(0, AXIS_FORMAT_METRIC);
switch($backgroundColor) { switch($backgroundColor) {
case 'white': case 'white':
$transparent = false; $transparent = false;

File diff suppressed because it is too large Load Diff