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 [7]:
# Since we want to use more features of google chart using google data table. Here v and f (formatters) is used.
# These can't be used in dataframe/vectors and using data array . 
# Hence directly generating the google data table from the options cols and rows.
opts = {
  cols: [{id: 'Name', label: 'Name', type: 'string'},
          {id: 'Manager', label: 'Manager', type: 'string'},
          {id: 'ToolTip', label: 'ToolTip', type: 'string'},
    ],
  rows: [
    {c:[{v:'Mike', f:'Mike<div style="color:red; font-style:italic">President</div>'}, {v: ''}, {v: 'The President'}]},
    {c:[{v:'Jim', f:'Jim<div style="color:red; font-style:italic">Vice President</div>'}, {v: 'Mike'}, {v: 'VP'}]},
    {c:[{v: 'Alice'}, {v: 'Mike'}, {v: ''}]},
    {c:[{v: 'Bob'}, {v: 'Jim'}, {v: 'Bob Sponge'}]},
    {c:[{v: 'Carol'}, {v: 'Bob'}, {v: ''}]},
  ]
}

org_chart_table = Daru::View::Table.new(opts)
org_chart_table.show_in_iruby
Out[7]:
In [9]:
org_chart_options = {
  type: :org, allowHtml:true
}
org_chart_chart = Daru::View::Plot.new(org_chart_table.table, org_chart_options)
org_chart_chart.show_in_iruby
Out[9]: