Skip to content

Commit

Permalink
size plot in given units or default pixels
Browse files Browse the repository at this point in the history
  • Loading branch information
TertiumQuid committed Sep 28, 2012
1 parent d908baa commit 7599e09
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion jqplot-rails.gemspec
Expand Up @@ -2,7 +2,7 @@ $:.push File.expand_path("../lib", __FILE__)


Gem::Specification.new do |s| Gem::Specification.new do |s|
s.name = "jqplot-rails" s.name = "jqplot-rails"
s.version = '1.0.1' s.version = '1.0.2'
s.platform = Gem::Platform::RUBY s.platform = Gem::Platform::RUBY
s.description = "JQPlot" s.description = "JQPlot"
s.summary = "This gem provides the JQPlot plugin assets to Rails apps." s.summary = "This gem provides the JQPlot plugin assets to Rails apps."
Expand Down
4 changes: 3 additions & 1 deletion lib/jqplot-rails/action_view/helpers/jqplot_helper.rb
Expand Up @@ -5,8 +5,10 @@ module JQPlotHelper


def jqplot(height, width, data_series, options={}) def jqplot(height, width, data_series, options={})
dom_id = SecureRandom.hex(12) 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'}, 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 end
end end
Expand Down

0 comments on commit 7599e09

Please sign in to comment.