Index: lnt/trunk/lnt/server/ui/templates/v4_graph.html =================================================================== --- lnt/trunk/lnt/server/ui/templates/v4_graph.html +++ lnt/trunk/lnt/server/ui/templates/v4_graph.html @@ -43,8 +43,31 @@ var db_name = "{{ request.view_args.get('db_name','') }}"; var graph_plots = {{graph_plots|tojson|safe}}; var baseline_plots = {{baseline_plots|tojson|safe}}; +var options = {{options|tojson|safe}}; prefix = "{{request.base_url}}"; +transform_fn = function (v) { return v; } +inverse_transform_fn = function (v) { return v; } + +if (options.logarithmic_scale) { + transform_fn = function(v) { + if (v < 0) + return -Math.log10(-v); + else if (v > 0) + return Math.log10(v); + else + return 0; + } + inverse_transform_fn = function(v) { + if (v < 0) + return -Math.pow(10, -v); + else if (v > 0) + return Math.pow(10, v); + else + return 0; + } +} + function init_graph() { // Set up the primary graph. var graph = $("#graph"); @@ -66,7 +89,10 @@ frameRate: 60 }, grid : { hoverable : true, - clickable: true } + clickable: true }, + yaxis: { + transform: transform_fn, + inverseTransform: inverse_transform_fn } }; // Add baseline lines @@ -207,6 +233,11 @@ {{ 'checked="checked"' if options.show_moving_median else ""}}/>