Class: Drawr::Pie

Inherits:
Base
  • Object
show all
Defined in:
lib/drawr.rb

Instance Attribute Summary

Attributes inherited from Base

#div, #hide_dots, #labels, #theme, #title

Instance Method Summary collapse

Methods inherited from Base

#to_s, #write, #write_to_div

Constructor Details

#initialize(target_width = 800) ⇒ Pie

Returns a new instance of Pie.



80
81
82
83
# File 'lib/drawr.rb', line 80

def initialize(target_width = 800)
  super(target_width)
  @extra_options[:strokewidth] = 1
end

Instance Method Details

#data(name, data_points = [], color = nil) ⇒ Object



85
86
87
88
89
# File 'lib/drawr.rb', line 85

def data(name, data_points = [], color = nil)
  @labels ||= {}
  @labels[@labels.length] = name
  super(name, data_points, color)
end