Module: Nyaplot::Diagrams::Vectors

Includes:
Jsonizable
Defined in:
lib/nyaplot/diagram.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Jsonizable

#before_to_json, #get_property, included, #init_properties, #set_property, #to_json

Instance Attribute Details

#colorArray<String>

Returns array of color codes

Returns:

  • (Array<String>)

    array of color codes



210
# File 'lib/nyaplot/diagram.rb', line 210

define_group_properties(:options, [:title, :x, :y, :dx, :dy, :fill_by, :color, :stroke_color, :stroke_width, :hover])

#dxSymbol

Returns the column label from which the line chart is created

Returns:

  • (Symbol)

    the column label from which the line chart is created



210
# File 'lib/nyaplot/diagram.rb', line 210

define_group_properties(:options, [:title, :x, :y, :dx, :dy, :fill_by, :color, :stroke_color, :stroke_width, :hover])

#dySymbol

Returns the column label from which the line chart is created

Returns:

  • (Symbol)

    the column label from which the line chart is created



210
# File 'lib/nyaplot/diagram.rb', line 210

define_group_properties(:options, [:title, :x, :y, :dx, :dy, :fill_by, :color, :stroke_color, :stroke_width, :hover])

#fill_bySymbol

Returns the column label to decide how to fill sybmols

Returns:

  • (Symbol)

    the column label to decide how to fill sybmols



210
# File 'lib/nyaplot/diagram.rb', line 210

define_group_properties(:options, [:title, :x, :y, :dx, :dy, :fill_by, :color, :stroke_color, :stroke_width, :hover])

#hoverBoolean

Returns whether to change color when hovering

Returns:

  • (Boolean)

    whether to change color when hovering



210
# File 'lib/nyaplot/diagram.rb', line 210

define_group_properties(:options, [:title, :x, :y, :dx, :dy, :fill_by, :color, :stroke_color, :stroke_width, :hover])

#stroke_colorString

Returns color code

Returns:

  • (String)

    color code



210
# File 'lib/nyaplot/diagram.rb', line 210

define_group_properties(:options, [:title, :x, :y, :dx, :dy, :fill_by, :color, :stroke_color, :stroke_width, :hover])

#stroke_widthNumeric

Returns the width of stroke

Returns:

  • (Numeric)

    the width of stroke



210
# File 'lib/nyaplot/diagram.rb', line 210

define_group_properties(:options, [:title, :x, :y, :dx, :dy, :fill_by, :color, :stroke_color, :stroke_width, :hover])

#titleString

Returns the title of this chart

Returns:

  • (String)

    the title of this chart



210
# File 'lib/nyaplot/diagram.rb', line 210

define_group_properties(:options, [:title, :x, :y, :dx, :dy, :fill_by, :color, :stroke_color, :stroke_width, :hover])

#xSymbol

Returns the column label from which the line chart is created

Returns:

  • (Symbol)

    the column label from which the line chart is created



210
# File 'lib/nyaplot/diagram.rb', line 210

define_group_properties(:options, [:title, :x, :y, :dx, :dy, :fill_by, :color, :stroke_color, :stroke_width, :hover])

#ySymbol

Returns the column label from which the line chart is created

Returns:

  • (Symbol)

    the column label from which the line chart is created



210
# File 'lib/nyaplot/diagram.rb', line 210

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



212
213
214
215
216
217
218
219
# File 'lib/nyaplot/diagram.rb', line 212

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

Returns:

  • (Boolean)


221
222
223
# File 'lib/nyaplot/diagram.rb', line 221

def zoom?
  true
end