module ZTK::GoogleChart::Base::Options

Public Instance Methods

options(value=nil) click to toggle source
# File lib/ztk/google_chart/base/options.rb, line 11
def options(value=nil)
  set_options(value)
end
options=(value) click to toggle source
# File lib/ztk/google_chart/base/options.rb, line 7
def options=(value)
  set_options(value)
end

Private Instance Methods

default_width() click to toggle source
# File lib/ztk/google_chart/base/options.rb, line 17
def default_width
  900
end
set_options(value=nil) click to toggle source
# File lib/ztk/google_chart/base/options.rb, line 21
def set_options(value=nil)
  if @chart_options.nil?
    @chart_options = Hash.new
    @chart_options.merge!(:width => default_width.to_i, :height => default_width.div(2).to_i)
  end

  if !value.nil? && !value.empty?
    @chart_options.merge!(value)
  end

  config.ui.logger.info { "options(#{value.inspect}) -> #{@chart_options.inspect}" }

  @chart_options
end