Module: Highcharts

Includes:
Base
Defined in:
lib/opal/highcharts/highcharts.rb,
lib/opal/highcharts/axis.rb,
lib/opal/highcharts/base.rb,
lib/opal/highcharts/chart.rb,
lib/opal/highcharts/point.rb,
lib/opal/highcharts/series.rb,
lib/opal/highcharts/options.rb,
lib/opal/highcharts/extremes.rb,
lib/opal/highcharts/renderer.rb

Overview

Defined Under Namespace

Modules: Base, NativePatches Classes: Axis, Chart, Extremes, Highcharts, Options, Point, Renderer, Series, UnsupportedFeature

Class Method Summary collapse

Methods included from Base

included

Class Method Details

.chart(options) ⇒ Object



6
7
8
# File 'lib/opal/highcharts/highcharts.rb', line 6

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

.chartsObject



10
11
12
# File 'lib/opal/highcharts/highcharts.rb', line 10

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

.date_format(format, time = nil, capitalize = false) ⇒ Object



14
15
16
# File 'lib/opal/highcharts/highcharts.rb', line 14

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

.date_formats(*args, &block) ⇒ Object

Raises:



18
19
20
# File 'lib/opal/highcharts/highcharts.rb', line 18

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

.number_format(number, decimals = nil, decimal_point = nil, thousands_sep = nil) ⇒ Object



22
23
24
# File 'lib/opal/highcharts/highcharts.rb', line 22

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

.options=(options) ⇒ Object

Set global/default chart options (hash)



32
33
34
# File 'lib/opal/highcharts/highcharts.rb', line 32

def self.options=(options)
  set_options(options)
end

.set_options(options) ⇒ Object

Set global/default chart options (hash)



27
28
29
# File 'lib/opal/highcharts/highcharts.rb', line 27

def self.set_options(options)
  `Highcharts.setOptions( #{ options.to_n } )`
end