lib/write_xlsx/chart/scatter.rb in write_xlsx-0.69.0 vs lib/write_xlsx/chart/scatter.rb in write_xlsx-0.70.0

- old
+ new

@@ -39,10 +39,11 @@ super(subtype) @subtype = subtype || 'marker_only' @cross_between = 'midCat' @horiz_val_axis = 0 @val_axis_position = 'b' + @smooth_allowed = 1 end # # Override the virtual superclass method with a chart specific method. # @@ -121,11 +122,15 @@ # Write the c:xVal element. write_x_val(series) # Write the c:yVal element. write_y_val(series) # Write the c:smooth element. - write_c_smooth + if @subtype =~ /smooth/ && !series[:_smooth] + write_c_smooth(1) + else + write_c_smooth(series[:_smooth]) + end end end # # Over-ridden to have 2 valAx elements for scatter charts instead of @@ -223,23 +228,9 @@ # def write_scatter_style(val) attributes = ['val', val] @writer.empty_tag('c:scatterStyle', attributes) - end - - # - # Write the <c:smooth> element. - # - def write_c_smooth - subtype = @subtype - val = 1 - - return unless subtype =~ /smooth/ - - attributes = ['val', val] - - @writer.empty_tag('c:smooth', attributes) end # # Add default formatting to the series data unless it has already been # specified by the user.