Module: Nyaplot::Diagrams::Line

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

#colorString

Returns the color code.

Returns:

  • (String)

    the color code



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

define_group_properties(:options, [:title, :x, :y, :color, :stroke_width, :legend])

#legendBool

Returns decide if the diagram prepare legend.

Returns:

  • (Bool)

    decide if the diagram prepare legend



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

define_group_properties(:options, [:title, :x, :y, :color, :stroke_width, :legend])

#stroke_widthNumeric

Returns the width of stroke.

Returns:

  • (Numeric)

    the width of stroke



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

define_group_properties(:options, [:title, :x, :y, :color, :stroke_width, :legend])

#titleString

Returns the title of this chart.

Returns:

  • (String)

    the title of this chart



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

define_group_properties(:options, [:title, :x, :y, :color, :stroke_width, :legend])

#xSymbol

Returns the column label from which the line chart is created.

Returns:

  • (Symbol)

    the column label from which the line chart is created



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

define_group_properties(:options, [:title, :x, :y, :color, :stroke_width, :legend])

#ySymbol

Returns the column label from which the line chart is created.

Returns:

  • (Symbol)

    the column label from which the line chart is created



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

define_group_properties(:options, [:title, :x, :y, :color, :stroke_width, :legend])

Instance Method Details

#process_data(df, labels) ⇒ Object



247
248
249
250
251
252
253
254
# File 'lib/nyaplot/diagram.rb', line 247

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)


256
257
258
# File 'lib/nyaplot/diagram.rb', line 256

def zoom?
  true
end