Skip to content

Commit

Permalink
Added ability to force X axis minimum to zero.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rok Strniša committed Apr 18, 2012
1 parent 5d4674e commit 45f7dbb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main.ml
Expand Up @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion static/rage.js
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 45f7dbb

Please sign in to comment.