class ChartJS::Point
Public Class Methods
new(container)
click to toggle source
# File lib/chart_js/chart/bar_chart/dataset/point.rb, line 8 def initialize(container) @container = container end
Public Instance Methods
border(&block)
click to toggle source
# File lib/chart_js/chart/bar_chart/dataset/point.rb, line 21 def border(&block) @container = PointBorder.new(@container).build(&block) end
build(&block)
click to toggle source
# File lib/chart_js/chart/bar_chart/dataset/point.rb, line 12 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.rb, line 41 def color(value, type = :both) case type when :border @container['pointBorderColor'] = value when :background @container['pointBackgroundColor'] = value when :both color value, :borer color value, :background end end
hit_radius(value)
click to toggle source
# File lib/chart_js/chart/bar_chart/dataset/point.rb, line 33 def hit_radius(value) if value.is_a? Array @container['pointHitRadius'] = value.map(&:to_i) else @container['pointHitRadius'] = value.to_i end end
hover(&block)
click to toggle source
# File lib/chart_js/chart/bar_chart/dataset/point.rb, line 17 def hover(&block) @container = PointHover.new(@container).build(&block) end
radius(value)
click to toggle source
# File lib/chart_js/chart/bar_chart/dataset/point.rb, line 25 def radius(value) if value.is_a? Array @container['pointRadius'] = value.map(&:to_i) else @container['pointRadius'] = value.to_i end end