Sha256: cd797aad124855d48fba6458d604e8b2a6049541b52a3ade8c89b5a028393785

Contents?: true

Size: 883 Bytes

Versions: 3

Compression:

Stored size: 883 Bytes

Contents

# http://api.highcharts.com/highcharts#Highcharts

module Highcharts
  include Base

  def self.chart(options)
    Chart.new(options)
  end

  def self.charts
    Native(`Highcharts.charts`).map { |e| Chart.new(e) }
  end

  def self.date_format(format, time = nil, capitalize = false)
    `Highcharts.dateFormat(#{format}, #{time}, #{capitalize})`
  end

  def self.date_formats(*args, &block)
    raise UnsupportedFeature, 'Highcharts.dateFormats'
  end

  def self.number_format(number, decimals = nil, decimal_point = nil, thousands_sep = nil)
    `Highcharts.dateFormat(#{number}, #{decimals}, #{decimal_point}, #{thousands_sep})`
  end

  # Set global/default chart options (hash)
  def self.set_options(options)
    `Highcharts.setOptions( #{ options.to_n } )`
  end

  # Set global/default chart options (hash)
  def self.options=(options)
    set_options(options)
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
opal-highcharts-0.1.3 lib/opal/highcharts/highcharts.rb
opal-highcharts-0.1.2 lib/opal/highcharts/highcharts.rb
opal-highcharts-0.1.1 lib/opal/highcharts/highcharts.rb