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,
ui_get_full_url("images/image_problem.opaque.png", false, false, false),
"", "", $homeurl, $water_mark, $config['fontpath'],
$fixed_font_size, "", $ttl, array(), array(), 0, 0, '',
false, '', true, $background_color);
$fixed_font_size, $unit, $ttl, array(), array(), 0, 0, '',
false, '', true, $background_color);
break;
default:
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_size'] = $font_size;
$graph['backgroundColor'] = $backgroundColor;
$graph['unit'] = $unit;
$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='(.+)'>/"

View File

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

File diff suppressed because it is too large Load Diff