From 45f7dbb4760b969f2828b3649aadbd26aa2762cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rok=20Strni=C5=A1a?= Date: Wed, 18 Apr 2012 16:20:51 +0000 Subject: [PATCH] Added ability to force X axis minimum to zero. --- src/main.ml | 1 + static/rage.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.ml b/src/main.ml index c27c60e..7ae1404 100644 --- a/src/main.ml +++ b/src/main.ml @@ -256,6 +256,7 @@ let show_configurations ~conn som_id tc_config_tbl = print_y_axis_choice configs som_configs_opt machines; let checkbox_prefix = "Show averages\n" checkbox_prefix; + printf "%s'x_from_zero' />Force X from 0\n" checkbox_prefix; printf "%s'y_from_zero' />Force Y from 0\n" checkbox_prefix; printf "%s'show_all_meta' />Show all meta-data\n" checkbox_prefix; printf "%s'yaxis_log' />Log scale Y
\n" checkbox_prefix; diff --git a/static/rage.js b/static/rage.js index c46aecd..55bc107 100644 --- a/static/rage.js +++ b/static/rage.js @@ -16,6 +16,7 @@ $("#reset_config").click(function() {window.location.href = get_som_url();}); $("select[name='xaxis']").change(fetch_data_and_replot); $("select[name='yaxis']").change(fetch_data_and_replot); $("input[name='show_avgs']").change(fetch_data_and_replot); +$("input[name='x_from_zero']").change(fetch_data_and_replot); $("input[name='y_from_zero']").change(fetch_data_and_replot); $("input[name='show_all_meta']").change(fetch_data_and_replot); $("input[name='yaxis_log']").change(fetch_data_and_replot); @@ -275,7 +276,9 @@ function onReceived(o) { legend: {type: "canvas", backgroundColor: "white"}, points: {show: true} }; - // force Y from 0 + // force X or Y from 0 + if ($("input[name='x_from_zero']").is(":checked")) + options.xaxis.min = 0; if ($("input[name='y_from_zero']").is(":checked")) options.yaxis.min = 0; // labels