Module: Nyaplot::Diagrams::Line
- Includes:
- Jsonizable
- Defined in:
- lib/nyaplot/diagram.rb
Instance Attribute Summary collapse
-
#color ⇒ String
The color code.
-
#stroke_width ⇒ Numeric
The width of stroke.
-
#title ⇒ String
The title of this chart.
-
#x ⇒ Symbol
The column label from which the line chart is created.
-
#y ⇒ Symbol
The column label from which the line chart is created.
Instance Method Summary collapse
Methods included from Jsonizable
#before_to_json, #get_property, included, #init_properties, #set_property, #to_json
Instance Attribute Details
#color ⇒ String
Returns the color code.
233 |
# File 'lib/nyaplot/diagram.rb', line 233 define_group_properties(:options, [:title, :x, :y, :color, :stroke_width]) |
#stroke_width ⇒ Numeric
Returns the width of stroke.
233 |
# File 'lib/nyaplot/diagram.rb', line 233 define_group_properties(:options, [:title, :x, :y, :color, :stroke_width]) |
#title ⇒ String
Returns the title of this chart.
233 |
# File 'lib/nyaplot/diagram.rb', line 233 define_group_properties(:options, [:title, :x, :y, :color, :stroke_width]) |
#x ⇒ Symbol
Returns the column label from which the line chart is created.
233 |
# File 'lib/nyaplot/diagram.rb', line 233 define_group_properties(:options, [:title, :x, :y, :color, :stroke_width]) |
#y ⇒ Symbol
Returns the column label from which the line chart is created.
233 |
# File 'lib/nyaplot/diagram.rb', line 233 define_group_properties(:options, [:title, :x, :y, :color, :stroke_width]) |
Instance Method Details
#process_data(df, labels) ⇒ Object
235 236 237 238 239 240 241 242 |
# File 'lib/nyaplot/diagram.rb', line 235 def process_data(df, labels) label_x = labels[0] label_y = labels[1] x(label_x) y(label_y) @xrange = [df[label_x].to_a.min, df[label_x].to_a.max] @yrange = [df[label_y].to_a.min, df[label_y].to_a.max] end |
#zoom? ⇒ Boolean
244 245 246 |
# File 'lib/nyaplot/diagram.rb', line 244 def zoom? true end |