class ChartJS::PointHover
Public Class Methods
new(container)
click to toggle source
# File lib/chart_js/chart/bar_chart/dataset/point_hover.rb, line 5 def initialize(container) @container = container end
Public Instance Methods
build(&block)
click to toggle source
# File lib/chart_js/chart/bar_chart/dataset/point_hover.rb, line 9 def build(&block) instance_eval(&block) @container end
color(value, type = :both)
click to toggle source
# File lib/chart_js/chart/bar_chart/dataset/point_hover.rb, line 30 def color(value, type = :both) case type when :border @container['pointHoverBorderColor'] = value when :background @container['pointHoverBackgroundColor'] = value when :both color value, :borer color value, :background end end
radius(value)
click to toggle source
# File lib/chart_js/chart/bar_chart/dataset/point_hover.rb, line 14 def radius(value) if value.is_a? Array @container['pointHoverRadius'] = value.map(&:to_i) else @container['pointHoverRadius'] = value.to_i end end
width(value)
click to toggle source
# File lib/chart_js/chart/bar_chart/dataset/point_hover.rb, line 22 def width(value) if value.is_a? Array @container['pointHoverBorderWidth'] = value.map(&:to_i) else @container['pointHoverBorderWidth'] = value.to_i end end