lib/write_xlsx/worksheet.rb in write_xlsx-0.55.0 vs lib/write_xlsx/worksheet.rb in write_xlsx-0.56.0
- old
+ new
@@ -2796,21 +2796,10 @@
@charts << [row, col, chart, x_offset, y_offset, scale_x, scale_y]
end
#
- # Sort the worksheet charts into the order that they were created in rather
- # than the insertion order. This is ensure that the chart and drawing objects
- # written in the same order. The chart id is used to sort back into creation
- # order.
- #
- def sort_charts
- return if @charts.size < 2
- @charts = @charts.sort {|a, b| a[2].id <=> b[2].id}
- end
-
- #
# :call-seq:
# insert_image(row, column, filename [ , x, y, scale_x, scale_y ] )
#
# Partially supported. Currently only works for 96 dpi images. This
# will be fixed in an upcoming release.
@@ -3639,11 +3628,11 @@
]
end
private :valid_table_parameter
#
- # add_sparkline
+ # Add sparklines to the worksheet.
#
def add_sparkline(param)
sparkline = {}
# Check for valid input parameters.
@@ -4650,9 +4639,10 @@
#
def prepare_chart(index, chart_id, drawing_id) # :nodoc:
drawing_type = 1
row, col, chart, x_offset, y_offset, scale_x, scale_y = @charts[index]
+ chart.id = chart_id - 1
scale_x ||= 0
scale_y ||= 0
width = (0.5 + (480 * scale_x)).to_i
height = (0.5 + (288 * scale_y)).to_i