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 ""}}/> + Show Logarithmic Scale + + + Moving Average/Median Window Size {# Split this into a new row to avoid making the dialog wider. #} Index: lnt/trunk/lnt/server/ui/views.py =================================================================== --- lnt/trunk/lnt/server/ui/views.py +++ lnt/trunk/lnt/server/ui/views.py @@ -791,6 +791,9 @@ request.args.get('moving_window_size', 10)) options['hide_highlight'] = bool( request.args.get('hide_highlight')) + options['logarithmic_scale'] = bool( + request.args.get('logarithmic_scale')) + show_highlight = not options['hide_highlight'] # Load the graph parameters.