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

This commit is contained in:
Arturo Gonzalez Diaz 2015-08-21 10:49:49 +02:00
parent fa83eac6c5
commit b4e9e2db83
4 changed files with 5032 additions and 5027 deletions

View File

@ -1366,8 +1366,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

@ -267,7 +267,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);

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)) {
@ -307,7 +310,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,
@ -624,9 +627,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,8 @@ function pch_vertical_graph ($graph_type, $index, $data, $width, $height,
$MyData->setSerieWeight($point_id, 0); $MyData->setSerieWeight($point_id, 0);
} }
$MyData->setAxisUnit(0, $unit);
$MyData->setAxisDisplay(0, AXIS_FORMAT_METRIC);
//$MyData->addPoints($data,"Yaxis"); //$MyData->addPoints($data,"Yaxis");
$MyData->setAxisName(0,$yaxisname); $MyData->setAxisName(0,$yaxisname);
$MyData->addPoints($index,"Xaxis"); $MyData->addPoints($index,"Xaxis");

File diff suppressed because it is too large Load Diff