Skip to content
Browse files

size plot in given units or default pixels

  • Loading branch information...
1 parent d908baa commit 7599e09727c1b29c755fc0b63af5f90ffbfbe328 @TertiumQuid TertiumQuid committed Sep 28, 2012
Showing with 4 additions and 2 deletions.
  1. +1 −1 jqplot-rails.gemspec
  2. +3 −1 lib/jqplot-rails/action_view/helpers/jqplot_helper.rb
View
2 jqplot-rails.gemspec
@@ -2,7 +2,7 @@ $:.push File.expand_path("../lib", __FILE__)
Gem::Specification.new do |s|
s.name = "jqplot-rails"
- s.version = '1.0.1'
+ s.version = '1.0.2'
s.platform = Gem::Platform::RUBY
s.description = "JQPlot"
s.summary = "This gem provides the JQPlot plugin assets to Rails apps."
View
4 lib/jqplot-rails/action_view/helpers/jqplot_helper.rb
@@ -5,8 +5,10 @@ module JQPlotHelper
def jqplot(height, width, data_series, options={})
dom_id = SecureRandom.hex(12)
+ height = height.is_a?(String) ? height : "#{height}px"
+ width = width.is_a?(String) ? width : "#{width}px"
tag "div", :data => {:series => data_series, :options => options, :role => 'jqplot'},
- :id => dom_id, :style => "height:#{height}px;width:#{width}px"
+ :id => dom_id, :style => "height:#{height};width:#{width}"
end
end
end

0 comments on commit 7599e09

Please sign in to comment.
Something went wrong with that request. Please try again.