lib/write_xlsx/chart/column.rb in write_xlsx-0.0.4 vs lib/write_xlsx/chart/column.rb in write_xlsx-0.51.0

- old
+ new

@@ -26,22 +26,22 @@ # chart = workbook.add_chart( :type => 'column', :subtype => 'stacked' ) # class Column < self include Writexlsx::Utility - def initialize - super(self.class) - @subtype = 'clustered' + def initialize(subtype) + super(subtype) + @subtype = subtype || 'clustered' @horiz_val_axis = 0 end # # Override the virtual superclass method with a chart specific method. # - def write_chart_type + def write_chart_type(params) # Write the c:barChart element. - write_bar_chart + write_bar_chart(params) end # # Write the <c:barDir> element. # @@ -49,19 +49,9 @@ val = 'col' attributes = ['val', val] @writer.empty_tag('c:barDir', attributes) - end - - - # - # Over-ridden to add c:overlap. - # - # Write the series elements. - # - def write_series - write_series_base {write_overlap if @subtype =~ /stacked/} end # # Over-ridden to add % format. TODO. This will be refactored back up to the # SUPER class later.