lib/axlsx/drawing/bar_chart.rb in caxlsx-3.3.0 vs lib/axlsx/drawing/bar_chart.rb in caxlsx-3.4.0
- old
+ new
@@ -1,15 +1,12 @@
-# encoding: UTF-8
module Axlsx
-
# The BarChart is a two dimentional barchart that you can add to your worksheet.
# @see Worksheet#add_chart
# @see Chart#add_series
# @see Package#serialize
# @see README for an example
class BarChart < Chart
-
# the category axis
# @return [CatAxis]
def cat_axis
axes[:cat_axis]
end
@@ -35,11 +32,11 @@
def gap_width
@gap_width ||= 150
end
alias :gapWidth :gap_width
- #grouping for a column, line, or area chart.
+ # grouping for a column, line, or area chart.
# must be one of [:percentStacked, :clustered, :standard, :stacked]
# @return [Symbol]
def grouping
@grouping ||= :clustered
end
@@ -64,11 +61,11 @@
# @option options [Symbol] bar_dir
# @option options [Symbol] grouping
# @option options [String] gap_width
# @option options [Symbol] shape
# @see Chart
- def initialize(frame, options={})
+ def initialize(frame, options = {})
@vary_colors = true
@gap_width, @overlap, @shape = nil, nil, nil
super(frame, options)
@series_type = BarSeries
@d_lbls = nil
@@ -80,27 +77,27 @@
RestrictionValidator.validate "BarChart.bar_dir", [:bar, :col], v
@bar_dir = v
end
alias :barDir= :bar_dir=
- #grouping for a column, line, or area chart.
+ # grouping for a column, line, or area chart.
# must be one of [:percentStacked, :clustered, :standard, :stacked]
def grouping=(v)
RestrictionValidator.validate "BarChart.grouping", [:percentStacked, :clustered, :standard, :stacked], v
@grouping = v
end
# space between bar or column clusters, as a percentage of the bar or column width.
def gap_width=(v)
RangeValidator.validate "BarChart.gap_width", 0, 500, v
- @gap_width=(v)
+ @gap_width = (v)
end
alias :gapWidth= :gap_width=
def overlap=(v)
RangeValidator.validate "BarChart.overlap", -100, 100, v
- @overlap=(v)
+ @overlap = (v)
end
# The shape of the bars or columns
# must be one of [:cone, :coneToMax, :box, :cylinder, :pyramid, :pyramidToMax]
def shape=(v)
@@ -130,9 +127,9 @@
# A hash of axes used by this chart. Bar charts have a value and
# category axes specified via axes[:val_axes] and axes[:cat_axis]
# @return [Axes]
def axes
- @axes ||= Axes.new(:cat_axis => CatAxis, :val_axis => ValAxis)
+ @axes ||= Axes.new(:cat_axis => CatAxis, :val_axis => ValAxis)
end
end
end