diff --git a/app/controllers/charts_controller.rb b/app/controllers/charts_controller.rb index 6a29517..5d5da11 100644 --- a/app/controllers/charts_controller.rb +++ b/app/controllers/charts_controller.rb @@ -40,9 +40,11 @@ class ChartsController < ApplicationController # allow these parameters when creating feed querystring feed_params = ['key','days','start','end','round','timescale','average','median','sum','results','location','status'] - # default chart size - @width = Chart.default_width - @height = Chart.default_height + # set chart size + width = params[:width].present? ? params[:width] : Chart.default_width + @width_style = (width == 'auto') ? '' : "width: #{width.to_i - 25}px;" + height = params[:height].present? ? params[:height] : Chart.default_height + @height_style = (height == 'auto') ? '' : "height: #{height.to_i - 25}px;" # add extra parameters to querystring @qs = '' diff --git a/app/views/charts/show.html.erb b/app/views/charts/show.html.erb index 425b7d1..76322d1 100644 --- a/app/views/charts/show.html.erb +++ b/app/views/charts/show.html.erb @@ -1,5 +1,5 @@ - +
<%= javascript_include_tag 'application' %> @@ -183,9 +183,9 @@ -;'> -