In [1]:
require 'daru/view'
Out[1]:
In [2]:
Daru::View.plotting_library = :googlecharts
Out[2]:
In [3]:
data_rows = [
['Label', 'Value'],
['Memory', 80],
['CPU', 55],
['Network', 68]
]
table_gauge = Daru::View::Table.new(data_rows)
table_gauge.show_in_iruby
Out[3]:
In [4]:
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
Out[4]:
In [ ]:
In [ ]: