lib/write_xlsx/chart/area.rb in write_xlsx-1.09.4 vs lib/write_xlsx/chart/area.rb in write_xlsx-1.09.5
- old
+ new
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
+
###############################################################################
#
# Area - A class for writing Excel Area charts.
#
# Used in conjunction with Chart.
@@ -25,13 +26,11 @@
@subtype = subtype || 'standard'
@cross_between = 'midCat'
@show_crosses = false
# Override and reset the default axis values.
- if @subtype == 'percent_stacked'
- @y_axis.defaults[:num_format] = '0%'
- end
+ @y_axis.defaults[:num_format] = '0%' if @subtype == 'percent_stacked'
set_y_axis
# Set the available data label positions for this chart type.
@label_position_default = 'center'
@@ -51,19 +50,19 @@
#
def write_area_chart(params)
series = axes_series(params)
return if series.empty?
- if @subtype == 'percent_stacked'
- subtype = 'percentStacked'
- else
- subtype = @subtype
- end
+ subtype = if @subtype == 'percent_stacked'
+ 'percentStacked'
+ else
+ @subtype
+ end
@writer.tag_elements('c:areaChart') do
# Write the c:grouping element.
write_grouping(subtype)
# Write the series elements.
- series.each {|s| write_series(s)}
+ series.each { |s| write_series(s) }
# Write the c:dropLines element.
write_drop_lines
# Write the c:marker element.