diff --git a/app/assets/javascripts/updateChart.js b/app/assets/javascripts/updateChart.js index 3a50104..ac60bbd 100644 --- a/app/assets/javascripts/updateChart.js +++ b/app/assets/javascripts/updateChart.js @@ -21,13 +21,11 @@ function updateChart(index, // default width and height var width = width; var height = height; - // get old src + // get old src var iframe = $('#iframe' + index).attr("default_src"); - if (!iframe) { - iframe = $('#iframe' + index).attr('src'); - } + if (!iframe) { iframe = $('#iframe' + index).attr('src'); } src = iframe.split('?')[0]; // if bar or column chart, a timeslice should be present or set timescale=30 @@ -83,26 +81,22 @@ function updateChart(index, $('#iframe' + index).attr('height', height); } function updateSelectValues() { - selectedValue = $(this).val(); - $(".mutuallyexclusive"+index).each(function () { $(this).val(""); }); - $(this).val(selectedValue); + selectedValue = $(this).val(); + $(".mutuallyexclusive"+index).each(function () { $(this).val(""); }); + $(this).val(selectedValue); } function setupChartForm(channelIndex) { - return function(index, value) { + return function(index, value) { if (value.length > 0) { - $('#' + value.split('=')[0] + "_" + channelIndex).val(decodeURIComponent(value.split('=')[1])); + $('#' + value.split('=')[0] + "_" + channelIndex).val(decodeURIComponent(value.split('=')[1])); } - }; + }; } - - - -function setupColumns(current_user, channel_id) -{ - $( sortColumnSetup(current_user, channel_id) ) ; - $( ".column" ).disableSelection(); +function setupColumns(current_user, channel_id) { + $( sortColumnSetup(current_user, channel_id) ); + $( ".column" ).disableSelection(); } function createWindowsWithData (data, current_user, channel_id, colName) { diff --git a/app/views/charts/_config.html.erb b/app/views/charts/_config.html.erb index a87609a..39a55f3 100644 --- a/app/views/charts/_config.html.erb +++ b/app/views/charts/_config.html.erb @@ -144,6 +144,14 @@ <%= t(:chart_max) %>: + + <%= t(:chart_yaxis_min) %>: + + + + <%= t(:chart_yaxis_max) %>: + + diff --git a/app/views/charts/show.html.erb b/app/views/charts/show.html.erb index 9aeb6a4..425b7d1 100644 --- a/app/views/charts/show.html.erb +++ b/app/views/charts/show.html.erb @@ -149,9 +149,11 @@ } }, yAxis: { - title: { - text: '' - } + title: { + text: '' + }, + min: <%= params[:yaxismin].present? ? params[:yaxismin] : 'null '%>, + max: <%= params[:yaxismax].present? ? params[:yaxismax] : 'null' %> }, exporting: { enabled: <%= (params[:export].present? && params[:export] == 'true') ? 'true' : 'false' %> diff --git a/app/views/docs/charts.html.erb b/app/views/docs/charts.html.erb index 03a739e..6556de3 100644 --- a/app/views/docs/charts.html.erb +++ b/app/views/docs/charts.html.erb @@ -33,6 +33,8 @@
  • dynamic (true/false) Make chart update automatically every 15 seconds, default: false (optional)
  • step (true/false) Draw chart as a step chart, default: false (optional)
  • export (true/false) Show export buttons, so that chart can be saved as an image, default: false (optional)
  • +
  • yaxismin (decimal) Minimum value of chart's Y-Axis; if blank the value is auto-calculated (optional)
  • +
  • yaxismax (decimal) Maximum value of chart's Y-Axis; if blank the value is auto-calculated (optional)

  • diff --git a/config/locales/en.yml b/config/locales/en.yml index 2cab867..d337ec3 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -70,8 +70,8 @@ en: channel_being_cleared: "This channel is currently being cleared. Any data you post to this channel before clearing is complete may be deleted." channel_video_type_blank: "Either Youtube, or Vimeo, is required if a Video ID is specified." chart: "Chart" - chart_max: "Max" - chart_min: "Min" + chart_max: "Data Max" + chart_min: "Data Min" chart_background_color: "Background" chart_is_dynamic: "Dynamic?" chart_embed_code: "Embed Code" @@ -84,6 +84,8 @@ en: chart_update: "Update Chart" chart_xaxis: "X-Axis" chart_yaxis: "Y-Axis" + chart_yaxis_min: "Y-Axis Min" + chart_yaxis_max: "Y-Axis Max" charts: "Charts" charts_view: "View Charts" comment_add: "Add comment"