Module: Nyaplot::Diagrams::Vectors
- Includes:
- Jsonizable
- Defined in:
- lib/nyaplot/diagram.rb
Instance Attribute Summary collapse
-
#color ⇒ Array<String>
Array of color codes.
-
#dx ⇒ Symbol
The column label from which the line chart is created.
-
#dy ⇒ Symbol
The column label from which the line chart is created.
-
#fill_by ⇒ Symbol
The column label to decide how to fill sybmols.
-
#hover ⇒ Boolean
Whether to change color when hovering.
-
#stroke_color ⇒ String
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 ⇒ Array<String>
Returns array of color codes.
214 |
# File 'lib/nyaplot/diagram.rb', line 214 define_group_properties(:options, [:title, :x, :y, :dx, :dy, :fill_by, :color, :stroke_color, :stroke_width, :hover]) |
#dx ⇒ Symbol
Returns the column label from which the line chart is created.
214 |
# File 'lib/nyaplot/diagram.rb', line 214 define_group_properties(:options, [:title, :x, :y, :dx, :dy, :fill_by, :color, :stroke_color, :stroke_width, :hover]) |
#dy ⇒ Symbol
Returns the column label from which the line chart is created.
214 |
# File 'lib/nyaplot/diagram.rb', line 214 define_group_properties(:options, [:title, :x, :y, :dx, :dy, :fill_by, :color, :stroke_color, :stroke_width, :hover]) |
#fill_by ⇒ Symbol
Returns the column label to decide how to fill sybmols.
214 |
# File 'lib/nyaplot/diagram.rb', line 214 define_group_properties(:options, [:title, :x, :y, :dx, :dy, :fill_by, :color, :stroke_color, :stroke_width, :hover]) |
#hover ⇒ Boolean
Returns whether to change color when hovering.
214 |
# File 'lib/nyaplot/diagram.rb', line 214 define_group_properties(:options, [:title, :x, :y, :dx, :dy, :fill_by, :color, :stroke_color, :stroke_width, :hover]) |
#stroke_color ⇒ String
Returns color code.
214 |
# File 'lib/nyaplot/diagram.rb', line 214 define_group_properties(:options, [:title, :x, :y, :dx, :dy, :fill_by, :color, :stroke_color, :stroke_width, :hover]) |
#stroke_width ⇒ Numeric
Returns the width of stroke.
214 |
# File 'lib/nyaplot/diagram.rb', line 214 define_group_properties(:options, [:title, :x, :y, :dx, :dy, :fill_by, :color, :stroke_color, :stroke_width, :hover]) |
#title ⇒ String
Returns the title of this chart.
214 |
# File 'lib/nyaplot/diagram.rb', line 214 define_group_properties(:options, [:title, :x, :y, :dx, :dy, :fill_by, :color, :stroke_color, :stroke_width, :hover]) |
#x ⇒ Symbol
Returns the column label from which the line chart is created.
214 |
# File 'lib/nyaplot/diagram.rb', line 214 define_group_properties(:options, [:title, :x, :y, :dx, :dy, :fill_by, :color, :stroke_color, :stroke_width, :hover]) |
#y ⇒ Symbol
Returns the column label from which the line chart is created.
214 |
# File 'lib/nyaplot/diagram.rb', line 214 define_group_properties(:options, [:title, :x, :y, :dx, :dy, :fill_by, :color, :stroke_color, :stroke_width, :hover]) |
Instance Method Details
#process_data(df, labels) ⇒ Object
216 217 218 219 220 221 222 223 |
# File 'lib/nyaplot/diagram.rb', line 216 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
225 226 227 |
# File 'lib/nyaplot/diagram.rb', line 225 def zoom? true end |