diff options
| author | Randy Morgan <[email protected]> | 2011-11-26 13:20:57 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2011-11-26 13:20:57 +0900 |
| commit | 11303a4d6664d9a7ff7bc408035d2ab70378a375 (patch) | |
| tree | 51c675ae3ab8cd6c1afd7087145261b1eb2ec54c /lib/axlsx/drawing/bar_3D_chart.rb | |
| parent | 044afe5a35db42cefce4f18a0fecc3da90cab1b5 (diff) | |
| download | caxlsx-11303a4d6664d9a7ff7bc408035d2ab70378a375.tar.gz caxlsx-11303a4d6664d9a7ff7bc408035d2ab70378a375.zip | |
adding in support for ruby 1.9.3
release version 1.0.9
Diffstat (limited to 'lib/axlsx/drawing/bar_3D_chart.rb')
| -rw-r--r-- | lib/axlsx/drawing/bar_3D_chart.rb | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/lib/axlsx/drawing/bar_3D_chart.rb b/lib/axlsx/drawing/bar_3D_chart.rb index 3d7f6296..6d74022f 100644 --- a/lib/axlsx/drawing/bar_3D_chart.rb +++ b/lib/axlsx/drawing/bar_3D_chart.rb @@ -18,25 +18,25 @@ module Axlsx # The direction of the bars in the chart # must be one of [:bar, :col] # @return [Symbol] - attr_accessor :barDir + attr_reader :barDir # space between bar or column clusters, as a percentage of the bar or column width. # @return [String] - attr_accessor :gapDepth + attr_reader :gapDepth # space between bar or column clusters, as a percentage of the bar or column width. # @return [String] - attr_accessor :gapWidth + attr_reader :gapWidth #grouping for a column, line, or area chart. # must be one of [:percentStacked, :clustered, :standard, :stacked] # @return [Symbol] - attr_accessor :grouping + attr_reader :grouping # The shabe of the bars or columns # must be one of [:cone, :coneToMax, :box, :cylinder, :pyramid, :pyramidToMax] # @return [Symbol] - attr_accessor :shape + attr_reader :shape # validation regex for gap amount percent GAP_AMOUNT_PERCENT = /0*(([0-9])|([1-9][0-9])|([1-4][0-9][0-9])|500)%/ @@ -61,6 +61,7 @@ module Axlsx def initialize(frame, options={}) @barDir = :bar @grouping = :clustered + @gapWidth, @gapDepth, @shape = nil, nil, nil @catAxId = rand(8 ** 8) @valAxId = rand(8 ** 8) @catAxis = CatAxis.new(@catAxId, @valAxId) @@ -69,28 +70,35 @@ module Axlsx @series_type = BarSeries @view3D = View3D.new({:rAngAx=>1}.merge(options)) end - + + # The direction of the bars in the chart + # must be one of [:bar, :col] def barDir=(v) RestrictionValidator.validate "Bar3DChart.barDir", [:bar, :col], v @barDir = v end - + #grouping for a column, line, or area chart. + # must be one of [:percentStacked, :clustered, :standard, :stacked] def grouping=(v) RestrictionValidator.validate "Bar3DChart.grouping", [:percentStacked, :clustered, :standard, :stacked], v @grouping = v end + # space between bar or column clusters, as a percentage of the bar or column width. def gapWidth=(v) RegexValidator.validate "Bar3DChart.gapWidth", GAP_AMOUNT_PERCENT, v @gapWidth=(v) end + # space between bar or column clusters, as a percentage of the bar or column width. def gapDepth=(v) RegexValidator.validate "Bar3DChart.gapWidth", GAP_AMOUNT_PERCENT, v @gapDepth=(v) end + # The shabe of the bars or columns + # must be one of [:cone, :coneToMax, :box, :cylinder, :pyramid, :pyramidToMax] def shape=(v) RestrictionValidator.validate "Bar3DChart.shape", [:cone, :coneToMax, :box, :cylinder, :pyramid, :pyramidToMax], v @shape = v |
