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 = [
['Director (Year)', 'Rotten Tomatoes', 'IMDB'],
['Alfred Hitchcock (1935)', 8.4, 7.9],
['Ralph Thomas (1959)', 6.9, 6.5],
['Don Sharp (1978)', 6.5, 6.4],
['James Hawes (2008)', 4.4, 6.2]
]
stepped_area_chart_table = Daru::View::Table.new(data)
stepped_area_chart_table.show_in_iruby
stepped_area_chart_options = {
type: :steppedArea, height: 400
}
stepped_area_chart_chart = Daru::View::Plot.new(stepped_area_chart_table.table, stepped_area_chart_options)
stepped_area_chart_chart.show_in_iruby
stepped_area_chart_options = {
title: 'The decline of \'The 39 Steps\'',
vAxis: {title: 'Accumulated Rating'},
isStacked: true,
type: :steppedArea, height: 400
}
stepped_area_chart_chart = Daru::View::Plot.new(stepped_area_chart_table.table, stepped_area_chart_options)
stepped_area_chart_chart.show_in_iruby
stepped_area_chart_options = {
backgroundColor: '#ddd',
legend: { position: 'bottom' },
connectSteps: false,
colors: ['#4374E0', '#53A8FB'],
isStacked: true,
type: :steppedArea, height: 400
}
stepped_area_chart_chart = Daru::View::Plot.new(stepped_area_chart_table.table, stepped_area_chart_options)
stepped_area_chart_chart.show_in_iruby
data = [
['Month', 'Bolivia', 'Ecuador', 'Madagascar', 'Papua New Guinea', 'Rwanda', 'Average'],
['2004/05', 165, 938, 522, 998, 450, 614.6],
['2005/06', 135, 1120, 599, 1268, 288, 682],
['2006/07', 157, 1167, 587, 807, 397, 623],
['2007/08', 139, 1110, 615, 968, 215, 609.4],
['2008/09', 136, 691, 629, 1026, 366, 569.6]
]
stepped_area_table = Daru::View::Table.new(data)
stepped_area_table.show_in_iruby
stepped_area_chart_options = {
isStacked: true,
legend: {position: 'top', maxLines: 3},
vAxis: {minValue: 0},
type: :steppedArea, height: 400
}
stepped_area_chart = Daru::View::Plot.new(stepped_area_table.table, stepped_area_chart_options)
stepped_area_chart.show_in_iruby
stepped_area_chart_options = {
isStacked: 'relative',
height: 300,
legend: {position: 'top', maxLines: 3},
vAxis: {
minValue: 0,
ticks: [0, 0.3, 0.6, 0.9, 1]
},
type: :steppedArea, height: 400
}
stepped_area_chart = Daru::View::Plot.new(stepped_area_table.table, stepped_area_chart_options)
stepped_area_chart.show_in_iruby
(pry):61: warning: key :height is duplicated and overwritten on line 67