class BarChart::VerticalBar

Public Instance Methods

height() click to toggle source
# File lib/charts/bar_chart/bar/vertical_bar.rb, line 30
def height
  chart.inner_height * (data_value - chart.base_line).abs
end
width() click to toggle source
# File lib/charts/bar_chart/bar/vertical_bar.rb, line 26
def width
  chart.bar_inner_width.floor.to_i
end
x() click to toggle source
# File lib/charts/bar_chart/bar/vertical_bar.rb, line 2
def x
  (x_margin + x_offset).floor.to_i
end
x_margin() click to toggle source
# File lib/charts/bar_chart/bar/vertical_bar.rb, line 6
def x_margin
  chart.outer_margin + chart.bar_margin + chart.group_margin * bar_nr_in_set
end
x_offset() click to toggle source
# File lib/charts/bar_chart/bar/vertical_bar.rb, line 10
def x_offset
  chart.bar_outer_width * bar_number_in_chart
end
y() click to toggle source
# File lib/charts/bar_chart/bar/vertical_bar.rb, line 14
def y
  y_margin + y_offset
end
y_margin() click to toggle source
# File lib/charts/bar_chart/bar/vertical_bar.rb, line 18
def y_margin
  chart.outer_margin
end
y_offset() click to toggle source
# File lib/charts/bar_chart/bar/vertical_bar.rb, line 22
def y_offset
  chart.inner_height * [(1 - data_value), (1 - chart.base_line)].min
end