Class: RailsCharts::CalendarChart

Inherits:
BaseChart
  • Object
show all
Defined in:
lib/rails_charts/calendar_chart.rb

Constant Summary

Constants inherited from BaseChart

BaseChart::CHART_JS_PATTERN

Instance Attribute Summary collapse

Attributes inherited from BaseChart

#chart_id, #container_id, #data, #debug, #height, #klass, #locale, #options, #other_options, #renderer, #style, #theme, #vertical, #width

Instance Method Summary collapse

Methods inherited from BaseChart

#axises, #js_code, #option, #x_axis, #y_axis

Constructor Details

#initialize(data, options = {}) ⇒ CalendarChart

Returns a new instance of CalendarChart.



5
6
7
# File 'lib/rails_charts/calendar_chart.rb', line 5

def initialize(data, options = {})
  super(data, options)
end

Instance Attribute Details

#visual_map_optionsObject (readonly)

Returns the value of attribute visual_map_options.



3
4
5
# File 'lib/rails_charts/calendar_chart.rb', line 3

def visual_map_options
  @visual_map_options
end

Instance Method Details

#build_optionsObject



13
14
15
# File 'lib/rails_charts/calendar_chart.rb', line 13

def build_options
  super.except(:xAxis, :yAxis)
end

#defaultsObject



25
26
27
28
29
30
31
32
33
# File 'lib/rails_charts/calendar_chart.rb', line 25

def defaults
  {
    tooltip: {
      item: {
        trigger: 'item',
      },
    },
  }
end

#generate_series_optionsObject



17
18
19
20
21
22
23
# File 'lib/rails_charts/calendar_chart.rb', line 17

def generate_series_options
  {
    type: type,
    coordinateSystem: 'calendar',
    data: data[:data]
  }
end

#typeObject



9
10
11
# File 'lib/rails_charts/calendar_chart.rb', line 9

def type
  'heatmap'
end