Class: Trackplot::Components::Candlestick

Inherits:
Base
  • Object
show all
Defined in:
lib/trackplot/components/candlestick.rb

Instance Attribute Summary

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Base

#initialize, #type

Constructor Details

This class inherits a constructor from Trackplot::Components::Base

Instance Method Details

#to_configObject



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/trackplot/components/candlestick.rb', line 4

def to_config
  {
    type: "candlestick",
    open: options[:open],
    high: options[:high],
    low: options[:low],
    close: options[:close],
    up_color: options[:up_color] || "#10b981",
    down_color: options[:down_color] || "#ef4444"
  }.compact
end