diff options
| author | Randy Morgan <[email protected]> | 2012-05-03 20:17:49 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-05-03 20:17:49 +0900 |
| commit | 55f3ade0b2fc64d414cb9a1c3bbdcb90bbe1289b (patch) | |
| tree | a2b7cc2ca957ed2d5294fc15c40f789859c710bd /lib/axlsx/drawing/axis.rb | |
| parent | e77c6ea64df17814c4a9820822d585c28ee6cc43 (diff) | |
| download | caxlsx-55f3ade0b2fc64d414cb9a1c3bbdcb90bbe1289b.tar.gz caxlsx-55f3ade0b2fc64d414cb9a1c3bbdcb90bbe1289b.zip | |
add support for axis delete, cat axis tickLblSkip and tickMarkSkip with sensible defaults. Improve chart positioning defaults.
Diffstat (limited to 'lib/axlsx/drawing/axis.rb')
| -rw-r--r-- | lib/axlsx/drawing/axis.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/axlsx/drawing/axis.rb b/lib/axlsx/drawing/axis.rb index 9d6a54c6..1e16dee6 100644 --- a/lib/axlsx/drawing/axis.rb +++ b/lib/axlsx/drawing/axis.rb @@ -44,6 +44,10 @@ module Axlsx # @return [Boolean] attr_reader :gridlines + # specifies if gridlines should be shown in the chart + # @return [Boolean] + attr_reader :delete + # Creates an Axis object # @param [Integer] axId the id of this axis # @param [Integer] crossAx the id of the perpendicular axis @@ -57,7 +61,7 @@ module Axlsx @axId = axId @crossAx = crossAx @format_code = "General" - @label_rotation = 0 + @delete = @label_rotation = 0 @scaling = Scaling.new(:orientation=>:minMax) self.axPos = :b self.tickLblPos = :nextTo @@ -84,6 +88,11 @@ module Axlsx # default true def gridlines=(v) Axlsx::validate_boolean(v); @gridlines = v; end + + # Specify if axis should be removed from the chart + # default false + def delete=(v) Axlsx::validate_boolean(v); @delete = v; end + # specifies how the perpendicular axis is crossed # must be one of [:autoZero, :min, :max] def crosses=(v) RestrictionValidator.validate "#{self.class}.crosses", [:autoZero, :min, :max], v; @crosses = v; end @@ -104,7 +113,7 @@ module Axlsx def to_xml_string(str = '') str << '<c:axId val="' << @axId.to_s << '"/>' @scaling.to_xml_string str - str << '<c:delete val="0"/>' + str << '<c:delete val="'<< @delete.to_s << '"/>' str << '<c:axPos val="' << @axPos.to_s << '"/>' str << '<c:majorGridlines>' if self.gridlines == false |
