Class: Xlsxrb::ChartBuilder
- Inherits:
-
Object
- Object
- Xlsxrb::ChartBuilder
- Defined in:
- lib/xlsxrb.rb,
sig/generated/xlsxrb.rbs
Overview
Builder for block-style chart definitions.
Defined Under Namespace
Classes: SeriesBuilder
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
: Hash[Symbol, untyped].
Instance Method Summary collapse
-
#category_axis(*args, **kwargs) ⇒ Object
Configures the category_axis property for this chart.
-
#chart_space(*args, **kwargs) ⇒ Object
Configures the chart_space property for this chart.
-
#data_labels(*args, **kwargs) ⇒ Object
Configures the data_labels property for this chart.
-
#display_blanks_as(*args, **kwargs) ⇒ Object
Configures the display_blanks_as property for this chart.
-
#initialize ⇒ ChartBuilder
constructor
: () -> void.
-
#legend(*args, **kwargs) ⇒ Object
Configures the legend property for this chart.
-
#plot_area(*args, **kwargs) ⇒ Object
Configures the plot_area property for this chart.
-
#plot_visible_only(*args, **kwargs) ⇒ Object
Configures the plot_visible_only property for this chart.
-
#series(value = nil) ⇒ void
: (?Hash[Symbol, untyped]? value) ?{ (SeriesBuilder) -> void } -> Array[Hash[Symbol, untyped]].
-
#show_legend_key(*args, **kwargs) ⇒ Object
Configures the show_legend_key property for this chart.
-
#style(*args, **kwargs) ⇒ Object
Configures the style property for this chart.
-
#title(value) ⇒ Object
: (untyped value) -> untyped.
-
#type(value) ⇒ Object
: (untyped value) -> untyped.
-
#value_axis(*args, **kwargs) ⇒ Object
Configures the value_axis property for this chart.
-
#view3d(*args, **kwargs) ⇒ Object
Configures the view3d property for this chart.
Constructor Details
#initialize ⇒ ChartBuilder
: () -> void
79 80 81 |
# File 'lib/xlsxrb.rb', line 79 def initialize @options = {} end |
Instance Attribute Details
#options ⇒ Object (readonly)
: Hash[Symbol, untyped]
83 84 85 |
# File 'lib/xlsxrb.rb', line 83 def @options end |
Instance Method Details
#category_axis(*args, **kwargs) ⇒ Object
Configures the category_axis property for this chart. : (*(Hash[Symbol, String | Integer | bool | nil] | String) args, **String | Integer | bool | nil kwargs) -> (Hash[Symbol, String | Integer | bool | nil] | String)
192 193 194 |
# File 'lib/xlsxrb.rb', line 192 def category_axis(*args, **kwargs) @options[:category_axis] = kwargs.empty? ? args.first : kwargs end |
#chart_space(*args, **kwargs) ⇒ Object
Configures the chart_space property for this chart. : (*(Hash[Symbol, String | Integer | bool | nil] | String) args, **String | Integer | bool | nil kwargs) -> (Hash[Symbol, String | Integer | bool | nil] | String)
132 133 134 |
# File 'lib/xlsxrb.rb', line 132 def chart_space(*args, **kwargs) @options[:chart_space] = kwargs.empty? ? args.first : kwargs end |
#data_labels(*args, **kwargs) ⇒ Object
Configures the data_labels property for this chart. : (*(Hash[Symbol, String | Integer | bool | nil] | String) args, **String | Integer | bool | nil kwargs) -> (Hash[Symbol, String | Integer | bool | nil] | String)
152 153 154 |
# File 'lib/xlsxrb.rb', line 152 def data_labels(*args, **kwargs) @options[:data_labels] = kwargs.empty? ? args.first : kwargs end |
#display_blanks_as(*args, **kwargs) ⇒ Object
Configures the display_blanks_as property for this chart. : (*(String) args, **String | Integer | bool | nil kwargs) -> String
172 173 174 |
# File 'lib/xlsxrb.rb', line 172 def display_blanks_as(*args, **kwargs) @options[:display_blanks_as] = kwargs.empty? ? args.first : kwargs end |
#legend(*args, **kwargs) ⇒ Object
Configures the legend property for this chart. : (*(Hash[Symbol, String | Integer | bool | nil] | String) args, **String | Integer | bool | nil kwargs) -> (Hash[Symbol, String | Integer | bool | nil] | String)
112 113 114 |
# File 'lib/xlsxrb.rb', line 112 def legend(*args, **kwargs) @options[:legend] = kwargs.empty? ? args.first : kwargs end |
#plot_area(*args, **kwargs) ⇒ Object
Configures the plot_area property for this chart. : (*(Hash[Symbol, String | Integer | bool | nil] | String) args, **String | Integer | bool | nil kwargs) -> (Hash[Symbol, String | Integer | bool | nil] | String)
122 123 124 |
# File 'lib/xlsxrb.rb', line 122 def plot_area(*args, **kwargs) @options[:plot_area] = kwargs.empty? ? args.first : kwargs end |
#plot_visible_only(*args, **kwargs) ⇒ Object
Configures the plot_visible_only property for this chart. : (*(bool | String) args, **String | Integer | bool | nil kwargs) -> (bool | String)
162 163 164 |
# File 'lib/xlsxrb.rb', line 162 def plot_visible_only(*args, **kwargs) @options[:plot_visible_only] = kwargs.empty? ? args.first : kwargs end |
#series(value = nil) ⇒ void
This method returns an undefined value.
: (?Hash[Symbol, untyped]? value) ?{ (SeriesBuilder) -> void } -> Array[Hash[Symbol, untyped]]
94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/xlsxrb.rb', line 94 def series(value = nil) @options[:series] ||= [] if block_given? sb = SeriesBuilder.new yield sb @options[:series] << sb. elsif value @options[:series] << value end @options[:series] end |
#show_legend_key(*args, **kwargs) ⇒ Object
Configures the show_legend_key property for this chart. : (*(bool | String) args, **String | Integer | bool | nil kwargs) -> (bool | String)
212 213 214 |
# File 'lib/xlsxrb.rb', line 212 def show_legend_key(*args, **kwargs) @options[:show_legend_key] = kwargs.empty? ? args.first : kwargs end |
#style(*args, **kwargs) ⇒ Object
Configures the style property for this chart. : (*(Hash[Symbol, String | Integer | bool | nil] | String | Integer) args, **String | Integer | bool | nil kwargs) -> (Hash[Symbol, String | Integer | bool | nil] | String | Integer)
142 143 144 |
# File 'lib/xlsxrb.rb', line 142 def style(*args, **kwargs) @options[:style] = kwargs.empty? ? args.first : kwargs end |
#title(value) ⇒ Object
: (untyped value) -> untyped
90 |
# File 'lib/xlsxrb.rb', line 90 def title(value) = @options[:title] = value |
#type(value) ⇒ Object
: (untyped value) -> untyped
87 88 89 |
# File 'lib/xlsxrb.rb', line 87 def type(value) = @options[:type] = value # @api public #: (untyped value) -> untyped |
#value_axis(*args, **kwargs) ⇒ Object
Configures the value_axis property for this chart. : (*(Hash[Symbol, String | Integer | bool | nil] | String) args, **String | Integer | bool | nil kwargs) -> (Hash[Symbol, String | Integer | bool | nil] | String)
202 203 204 |
# File 'lib/xlsxrb.rb', line 202 def value_axis(*args, **kwargs) @options[:value_axis] = kwargs.empty? ? args.first : kwargs end |
#view3d(*args, **kwargs) ⇒ Object
Configures the view3d property for this chart. : (*(Hash[Symbol, String | Integer | bool | nil] | String) args, **String | Integer | bool | nil kwargs) -> (Hash[Symbol, String | Integer | bool | nil] | String)
182 183 184 |
# File 'lib/xlsxrb.rb', line 182 def view3d(*args, **kwargs) @options[:view3d] = kwargs.empty? ? args.first : kwargs end |