2013-04-09 Dario Rodriguez <dario@artica.es>

* include/graphs/flot/pandora.flot.js: Fixed position algorithm for
        horizontal graphs usgin new javascript graph engine.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7950 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
darode 2013-04-09 17:52:41 +00:00
parent fd32e50bbe
commit d445d5f88d
2 changed files with 17 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2013-04-09 Dario Rodriguez <dario@artica.es>
* include/graphs/flot/pandora.flot.js: Fixed position algorithm for
horizontal graphs usgin new javascript graph engine.
2013-04-09 Miguel de Dios <miguel.dedios@artica.es> 2013-04-09 Miguel de Dios <miguel.dedios@artica.es>
* godmode/reporting/visual_console_builder.editor.js: fixed a * godmode/reporting/visual_console_builder.editor.js: fixed a

View File

@ -87,8 +87,7 @@ function pandoraFlotPie(graph_id, values, labels, nseries, width, font_size, wat
var legends = $('#'+graph_id+' .legendLabel'); var legends = $('#'+graph_id+' .legendLabel');
legends.each(function () { legends.each(function () {
// fix the widths so they don't jump around $(this).css('width', $(this).width());
$(this).css('width', $(this).width()+5);
$(this).css('font-size', font_size+'pt'); $(this).css('font-size', font_size+'pt');
}); });
@ -194,8 +193,16 @@ function pandoraFlotHBars(graph_id, values, labels, water_mark, maxvalue, water_
pixelPerValue = parseInt(plot.width()) / maxvalue; pixelPerValue = parseInt(plot.width()) / maxvalue;
inCanvasValuePos = parseInt(pixelPerValue * ($('#value_'+i+'_'+graph_id).html())); inCanvasValuePos = parseInt(pixelPerValue * ($('#value_'+i+'_'+graph_id).html()));
label_width = ($('#value_'+i+'_'+graph_id).css('width').split('px')[0] - 3);
$('#value_'+i+'_'+graph_id).css('left',plot.offset().left + inCanvasValuePos - $('#value_'+i+'_'+graph_id).css('width').split('px')[0] - 3);
label_left_offset = plot.offset().left + inCanvasValuePos + 5; //Label located on right side of bar + 5 pixels
//If label fit into the bar just recalculate left position to fit on right side of bar
if (inCanvasValuePos > label_width) {
label_left_offset = plot.offset().left + inCanvasValuePos - $('#value_'+i+'_'+graph_id).css('width').split('px')[0] - 3;
}
$('#value_'+i+'_'+graph_id).css('left',label_left_offset);
i++; i++;
}); });
@ -453,7 +460,6 @@ function pandoraFlotSlicebar(graph_id, values, datacolor, labels, legend, acumul
var extra_width = parseInt($('#extra_'+graph_id).css('width').split('px')[0]); var extra_width = parseInt($('#extra_'+graph_id).css('width').split('px')[0]);
$('#extra_'+graph_id).css('left',pos.pageX-(extra_width/2)+'px'); $('#extra_'+graph_id).css('left',pos.pageX-(extra_width/2)+'px');
$('#extra_'+graph_id).css('top',plot.offset().top-extra_height-5+'px'); $('#extra_'+graph_id).css('top',plot.offset().top-extra_height-5+'px');
$('#extra_'+graph_id).show(); $('#extra_'+graph_id).show();
} }
}); });
@ -1119,4 +1125,4 @@ function number_format(number, force_integer, unit) {
} }
return number+' '+shorts[pos]+unit; return number+' '+shorts[pos]+unit;
} }