Permalink
Browse files

Added ability to force X axis minimum to zero.

  • Loading branch information...
1 parent 5d4674e commit 45f7dbb4760b969f2828b3649aadbd26aa2762cd @rokstrnisa rokstrnisa committed Apr 18, 2012
Showing with 5 additions and 1 deletion.
  1. +1 −0 src/main.ml
  2. +4 −1 static/rage.js
View
1 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 = "<input type='checkbox' name=" in
printf "%s'show_avgs' />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<br />\n" checkbox_prefix;
View
5 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

0 comments on commit 45f7dbb

Please sign in to comment.