lib/write_xlsx/chart/pie.rb in write_xlsx-1.11.1 vs lib/write_xlsx/chart/pie.rb in write_xlsx-1.11.2
- old
+ new
@@ -121,12 +121,11 @@
# Over-ridden method to add <c:txPr> to legend.
#
# Write the <c:legend> element.
#
def write_legend
- position = @legend.position
- allowed = %w[right left top bottom]
+ allowed = %w[right left top bottom]
delete_series = @legend.delete_series || []
if @legend.position =~ /^overlay_/
position = @legend.position.sub(/^overlay_/, '')
overlay = true
@@ -204,9 +203,22 @@
#
# Write the <c:firstSliceAng> element.
#
def write_first_slice_ang
@writer.empty_tag('c:firstSliceAng', [['val', @rotation]])
+ end
+
+ #
+ # Write the <c:showLeaderLines> element. This is for Pie/Doughnut charts.
+ # Other chart types only supported leader lines after Excel 2015 via an
+ # extension element.
+ #
+ def write_show_leader_lines
+ val = 1
+
+ attributes = [['val', val]]
+
+ @writer.empty_tag('c:showLeaderLines', attributes)
end
end
end
end