Class: Squid::Graph
Instance Method Summary collapse
- #draw ⇒ Object
-
#initialize(document, data = {}, settings = {}) ⇒ Graph
constructor
A new instance of Graph.
Methods included from Settings
Constructor Details
#initialize(document, data = {}, settings = {}) ⇒ Graph
Returns a new instance of Graph.
18 19 20 21 22 |
# File 'lib/squid/graph.rb', line 18 def initialize(document, data = {}, settings = {}) @data, @settings = data, settings @plot = Plotter.new document, bottom: bottom @plot.paddings = {left: left.width, right: right.width} if @data.any? end |
Instance Method Details
#draw ⇒ Object
24 25 26 |
# File 'lib/squid/graph.rb', line 24 def draw @plot.box(h: height, border: border) { draw_graph if @data.any? } end |