summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/drawing/chart.rb
diff options
context:
space:
mode:
authorMoses Hohman <[email protected]>2013-06-23 02:02:01 -0500
committerMoses Hohman <[email protected]>2013-06-23 02:02:01 -0500
commit15e78a467348d744ee58039b484adb8083290fb9 (patch)
treefa5a6a124f8f3fff85a9cf5c239861b66ec5aeb7 /lib/axlsx/drawing/chart.rb
parent173f1c49fb449aebc5ddf30a9387006ee54e5260 (diff)
downloadcaxlsx-15e78a467348d744ee58039b484adb8083290fb9.tar.gz
caxlsx-15e78a467348d744ee58039b484adb8083290fb9.zip
provide a better default for dispBlanksAs and allow it to be configured
Diffstat (limited to 'lib/axlsx/drawing/chart.rb')
-rw-r--r--lib/axlsx/drawing/chart.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/axlsx/drawing/chart.rb b/lib/axlsx/drawing/chart.rb
index 79019a0a..5f7db77f 100644
--- a/lib/axlsx/drawing/chart.rb
+++ b/lib/axlsx/drawing/chart.rb
@@ -20,6 +20,7 @@ module Axlsx
@graphic_frame.anchor.drawing.worksheet.workbook.charts << self
@series = SimpleTypedList.new Series
@show_legend = true
+ @display_blanks_as = :gap
@series_type = Series
@title = Title.new
parse_options options
@@ -70,6 +71,15 @@ module Axlsx
# @return [Boolean]
attr_reader :show_legend
+ # How to display blank values
+ # Options are
+ # * gap: Display nothing
+ # * span: Not sure what this does
+ # * zero: Display as if the value were zero, not blank
+ # @return [Symbol]
+ # Default :gap (although this really should vary by chart type and grouping)
+ attr_reader :display_blanks_as
+
# returns a relationship object for the chart
# @return [Axlsx::Relationship]
def relationship
@@ -105,6 +115,12 @@ module Axlsx
# @return [Boolean]
def show_legend=(v) Axlsx::validate_boolean(v); @show_legend = v; end
+ # How to display blank values
+ # @see display_blanks_as
+ # @param [Symbol] v
+ # @return [Symbol]
+ def display_blanks_as=(v) Axlsx::validate_display_blanks_as(v); @display_blanks_as = v; end
+
# The style for the chart.
# see ECMA Part 1 ยง21.2.2.196
# @param [Integer] v must be between 1 and 48
@@ -158,6 +174,7 @@ module Axlsx
end
str << '<c:plotVisOnly val="1"/>'
str << '<c:dispBlanksAs val="zero"/>'
+ # str << '<c:dispBlanksAs val="' << display_blanks_as.to_s << '"/>'
str << '<c:showDLblsOverMax val="1"/>'
str << '</c:chart>'
str << '<c:printSettings>'