Method: StockMarkit::Chart#initialize

Defined in:
lib/stock-markit/chart.rb

#initialize(opts) ⇒ Chart

Returns a new instance of Chart.

Parameters:

  • opts (Hash)

    a customizable set of options

Options Hash (opts):

  • :normalized (Boolean)

    Show data in price units (false) or percentages (true)

  • :start_date (Time)

    The beginning date for the chart

  • :end_date (Time)

    The end date of the chart

  • :offset (Integer)

    Number of days back that chart should end. Defaults to 0 if not specified. May be used instead of :end_date for interday requests.

  • :number_of_days (Integer)

    Number of days that should be shown on the chart. Required for intraday requests. May be used instead of :start_date for interday requests.

  • :data_period (Symbol)

    The type of data requested. :Minute, :Hour, :Day, :Week, :Month, :Quarter, :Year

  • :data_interval (Integer)

    For intraday data, specifies the number of periods between data points. e.g. if DataPeriod is Minute and DataInterval is 5, you will get a chart with five minute intervals. Must be 0 or null for interday charts

  • :label_period (Symbol)

    The TimePeriod over which to create labels. Control how often you want labels by setting LabelInterval. :Minute, :Hour, :Day, :Week, :Month, :Quarter, :Year

  • :label_interval (Integer)

    How many LabelPeriods to skip between labels

  • :elements (Array<StockMarkit::Element>)

    An Array of 1 or more Elements.



32
33
34
# File 'lib/stock-markit/chart.rb', line 32

def initialize(opts)
  @opts = opts
end