2013-10-14 Miguel de Dios <miguel.dedios@artica.es>

* include/graphs/flot/pandora.flot.js,
	include/graphs/functions_flot.php, operation/agentes/stat_win.php:
	fixed the charts with negative values and a flot type.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8906 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-10-14 11:48:51 +00:00
parent 4524961a4e
commit 3a215820c1
4 changed files with 86 additions and 44 deletions

View File

@ -1,3 +1,9 @@
2013-10-14 Miguel de Dios <miguel.dedios@artica.es>
* include/graphs/flot/pandora.flot.js,
include/graphs/functions_flot.php, operation/agentes/stat_win.php:
fixed the charts with negative values and a flot type.
2013-10-14 Vanessa Gil <vanessa.gil@artica.es>
* include/languages/ar.mo

View File

@ -606,7 +606,13 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, colors,
label: legend[i],
color: serie_color,
//threshold: [{ below: 80, color: "rgb(200, 20, 30)" } , { below: 65, color: "rgb(30, 200, 30)" }, { below: 50, color: "rgb(30, 200, 30)" }],
lines: { show: line_show, fill: filled, fillColor: { colors: [ { opacity: 0.9 }, { opacity: 0.9 } ]}, lineWidth:1, steps:false },
lines: { show: line_show,
fill: filled,
fillColor: {
colors: [ { opacity: 0.9 }, { opacity: 0.9 } ]
},
lineWidth: 1,
steps: false },
points: { show: points_show }
});
@ -664,7 +670,6 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, colors,
} ],
yaxes: [ {
tickFormatter: yFormatter,
min: 0,
color: '#000'
},
{
@ -705,7 +710,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, colors,
minTickSize: steps,
color: '#000'
} ],
yaxis: { ticks: [], min: 0, autoscaleMargin: 0.1 },
yaxis: {ticks: [], autoscaleMargin: 0.1 },
selection: {mode: 'x', color: '#777' },
legend: {show: false},
crosshair: {mode: 'x'}
@ -736,14 +741,16 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, colors,
legend: { show: false }
}));
$('#menu_cancelzoom_'+graph_id).attr('src',homeurl+'/images/zoom_cross.png');
$('#menu_cancelzoom_' + graph_id)
.attr('src',homeurl + '/images/zoom_cross.png');
currentRanges = ranges;
// don't fire event on the overview to prevent eternal loop
overview.setSelection(ranges, true);
});
$('#overview_'+graph_id).bind('plotselected', function (event, ranges) {
$('#overview_' + graph_id)
.bind('plotselected', function (event, ranges) {
plot.setSelection(ranges);
});
@ -991,7 +998,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, colors,
// cancel the zooming
plot = $.plot($('#'+graph_id), data_base,
$.extend(true, {}, options, {
xaxis: { min: 0, max: max_x },
xaxis: {max: max_x },
legend: { show: false }
}));

View File

@ -300,12 +300,40 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend, $long_in
}
// Trick to get translated string from javascript
$return .= html_print_input_hidden('unknown_text', __('Unknown'), true);
$return .= html_print_input_hidden('unknown_text', __('Unknown'),
true);
// Javascript code
$return .= "<script type='text/javascript'>";
$return .= "//<![CDATA[\n";
$return .= "pandoraFlotArea('$graph_id', '$values', '$labels', '$labels_long', '$legend', '$colors', '$type', '$serie_types', $watermark, $width, $max_x, '".$config['homeurl']."', '$unit', $font_size, $menu, '$events', '$event_ids', '$legend_events', '$alerts', '$alert_ids', '$legend_alerts', '$yellow_threshold', '$red_threshold', $force_integer, '$separator', '$separator2', '$series_suffix_str');";
$return .= "pandoraFlotArea(" .
"'$graph_id', " .
"'$values', " .
"'$labels', " .
"'$labels_long', " .
"'$legend', " .
"'$colors', " .
"'$type', " .
"'$serie_types', " .
"$watermark, " .
"$width, " .
"$max_x, " .
"'" . $config['homeurl'] . "', " .
"'$unit', " .
"$font_size, " .
"$menu, " .
"'$events', " .
"'$event_ids', " .
"'$legend_events', " .
"'$alerts', " .
"'$alert_ids', " .
"'$legend_alerts', " .
"'$yellow_threshold', " .
"'$red_threshold', " .
"$force_integer, " .
"'$separator', " .
"'$separator2', " .
"'$series_suffix_str');";
$return .= "\n//]]>";
$return .= "</script>";

View File

@ -161,6 +161,7 @@ $label = base64_decode(get_parameter('label', ''));
echo '<div style="margin-left: 70px; padding-top: 10px;">';
else
echo '<div style="margin-left: 50px; padding-top: 10px;">';
switch ($graph_type) {
case 'boolean':
echo grafico_modulo_boolean ($id, $period, $draw_events, $width, $height,