Class: Trackplot::Components::DataLabel

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

Constant Summary collapse

FORMAT_SYMBOLS =
{
  currency: "currency",
  percent: "percent",
  compact: "compact",
  decimal: "decimal",
  integer: "integer"
}.freeze

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



12
13
14
15
16
17
18
19
# File 'lib/trackplot/components/data_label.rb', line 12

def to_config
  {
    type: "data_label",
    format: resolve_format(options[:format]),
    position: (options[:position] || :top).to_s,
    font_size: options[:font_size] || 11
  }.compact
end