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.
true
Daru::View.plotting_library = :googlecharts
:googlecharts
data_rows = [
['Label', 'Value'],
['Memory', 80],
['CPU', 55],
['Network', 68]
]
table_gauge = Daru::View::Table.new(data_rows)
table_gauge.show_in_iruby
opts = {
width: 400, height: 120,
redFrom: 90, redTo: 100,
yellowFrom:75, yellowTo: 90,
minorTicks: 5,
type: :gauge
}
gauge_chart = Daru::View::Plot.new(table_gauge, opts)
gauge_chart.show_in_iruby