Added size controller to legend in graphs. Ticket #4114
This commit is contained in:
parent
f81af8b437
commit
397428c3ee
|
@ -1703,6 +1703,16 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
|
||||||
|
|
||||||
var y = series.data[j][1];
|
var y = series.data[j][1];
|
||||||
|
|
||||||
|
var how_bigger = "";
|
||||||
|
if (y > 1000000) {
|
||||||
|
how_bigger = "M";
|
||||||
|
y = y / 1000000;
|
||||||
|
}
|
||||||
|
else if (y > 1000) {
|
||||||
|
how_bigger = "K";
|
||||||
|
y = y / 1000;
|
||||||
|
}
|
||||||
|
|
||||||
if (currentRanges == null || (currentRanges.xaxis.from < j && j < currentRanges.xaxis.to)) {
|
if (currentRanges == null || (currentRanges.xaxis.from < j && j < currentRanges.xaxis.to)) {
|
||||||
$('#timestamp_'+graph_id).show();
|
$('#timestamp_'+graph_id).show();
|
||||||
// If no legend, the timestamp labels are short and with value
|
// If no legend, the timestamp labels are short and with value
|
||||||
|
@ -1741,7 +1751,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
|
||||||
// The graphs of points type and unknown graphs will dont be updated
|
// The graphs of points type and unknown graphs will dont be updated
|
||||||
if (serie_types[i] != 'points' && series.label != $('#hidden-unknown_text').val()) {
|
if (serie_types[i] != 'points' && series.label != $('#hidden-unknown_text').val()) {
|
||||||
$('#legend_' + graph_id + ' .legendLabel')
|
$('#legend_' + graph_id + ' .legendLabel')
|
||||||
.eq(i).html(label_aux + '= ' + parseFloat(y).toFixed(2) + ' ' + unit);
|
.eq(i).html(label_aux + '= ' + parseFloat(y).toFixed(precision_graph) + how_bigger + ' ' + unit);
|
||||||
console.log($('#legend_' + graph_id + ' .legendLabel'));
|
console.log($('#legend_' + graph_id + ' .legendLabel'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue