In [1]:
require 'daru/view'
Install the spreadsheet gem version ~>1.1.1 for using spreadsheet functions.

Install the mechanize gem version ~>2.7.5 for using mechanize functions.
Out[1]:
true
In [2]:
Daru::View.plotting_library = :googlecharts
Out[2]:
:googlecharts
In [3]:
data_rows = [
          ['Mon', 20, 28, 38, 45],
      ['Tue', 31, 38, 55, 66],
      ['Wed', 50, 55, 77, 80],
      ['Thu', 77, 77, 66, 50],
      ['Fri', 68, 66, 22, 15]
]
df_Candlestick = Daru::DataFrame.rows(data_rows)

df_Candlestick
Out[3]:
Daru::DataFrame(5x5)
0 1 2 3 4
0 Mon 20 28 38 45
1 Tue 31 38 55 66
2 Wed 50 55 77 80
3 Thu 77 77 66 50
4 Fri 68 66 22 15
In [7]:
candlestick_chart = Daru::View::Plot.new(df_Candlestick, type: :candlestick, height: 500)
candlestick_chart.show_in_iruby
Out[7]:

Waterfall charts

In [9]:
opts = {
  type: :candlestick, height: 500,
  legend: 'none',
          bar: { groupWidth: '100%' }, # Remove space between bars.
          candlestick: {
            fallingColor: { strokeWidth: 0, fill: '#a52714' }, # red
            risingColor: { strokeWidth: 0, fill: '#0f9d58' }   # green
          }
  }
waterfall_chart = Daru::View::Plot.new(df_Candlestick, opts)
waterfall_chart.show_in_iruby
Out[9]: