From f511d7ee09709d3ebe0948aecd02afe0ff04c13c Mon Sep 17 00:00:00 2001 From: Ruslan Kornev Date: Fri, 7 Aug 2015 17:54:38 +0500 Subject: allow to use d_lbl_pos for LineChart --- lib/axlsx/drawing/d_lbls.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/axlsx/drawing/d_lbls.rb b/lib/axlsx/drawing/d_lbls.rb index 74c01350..d2185033 100644 --- a/lib/axlsx/drawing/d_lbls.rb +++ b/lib/axlsx/drawing/d_lbls.rb @@ -49,7 +49,7 @@ module Axlsx # @see d_lbl_pos= for a list of allowed values # @return [Symbol] def d_lbl_pos - return unless @chart_type == Pie3DChart + return unless [Pie3DChart, LineChart].include? @chart_type @d_lbl_pos ||= :bestFit end @@ -60,7 +60,7 @@ module Axlsx # The default is :bestFit # @param [Symbol] label_position the postion you want to use. def d_lbl_pos=(label_position) - return unless @chart_type == Pie3DChart + return unless [Pie3DChart, LineChart].include? @chart_type Axlsx::RestrictionValidator.validate 'DLbls#d_lbl_pos', [:bestFit, :b, :ctr, :inBase, :inEnd, :l, :outEnd, :r, :t], label_position @d_lbl_pos = label_position end @@ -80,7 +80,7 @@ module Axlsx # nills out d_lbl_pos and show_leader_lines as these attributes, while valid in the spec actually chrash excel for any chart type other than pie charts. def validate_attributes_for_chart_type - return if @chart_type == Pie3DChart + return if [Pie3DChart, LineChart].include? @chart_type @d_lbl_pos = nil @show_leader_lines = nil end -- cgit v1.2.3