Class: Xlsxrb::ChartBuilder::SeriesBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/xlsxrb/chart_builder.rb,
sig/generated/xlsxrb/chart_builder.rbs

Overview

Builder for a single series entry in block-style chart definitions.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSeriesBuilder

: () -> void



203
204
205
# File 'lib/xlsxrb/chart_builder.rb', line 203

def initialize
  @options = {}
end

Instance Attribute Details

#optionsHash{Symbol => Object} (readonly)

: Hash[Symbol, untyped]

Returns:

  • (Hash{Symbol => Object})


209
210
211
# File 'lib/xlsxrb/chart_builder.rb', line 209

def options
  @options
end

Instance Method Details

#categories(*args, **kwargs) ⇒ Object

Configures categories reference for this series (e.g. "Sheet1!$A$2:$A$10").

: (*untyped args, **untyped kwargs) -> untyped

Parameters:

  • args (Array)

    Positional arguments.

  • kwargs (Hash)

    Keyword arguments.

Returns:

  • (Object)


218
219
220
# File 'lib/xlsxrb/chart_builder.rb', line 218

def categories(*args, **kwargs)
  @options[:categories] = kwargs.empty? ? args.first : kwargs
end

#data_labels(*args, **kwargs) ⇒ Object

Configures data labels for this series.

: (*(Hash[Symbol, String | Integer | bool | nil] | String) args, **String | Integer | bool | nil kwargs) -> (Hash[Symbol, String | Integer | bool | nil] | String)

Parameters:

  • args (Array)

    Positional arguments.

  • kwargs (Hash)

    Keyword arguments.

Returns:

  • (Object)


295
296
297
# File 'lib/xlsxrb/chart_builder.rb', line 295

def data_labels(*args, **kwargs)
  @options[:data_labels] = kwargs.empty? ? args.first : kwargs
end

#fill(*args, **kwargs) ⇒ Object

Configures fill color/pattern for this series.

: (*(Hash[Symbol, String | Integer | bool | nil] | String) args, **String | Integer | bool | nil kwargs) -> (Hash[Symbol, String | Integer | bool | nil] | String)

Parameters:

  • args (Array)

    Positional arguments.

  • kwargs (Hash)

    Keyword arguments.

Returns:

  • (Object)


262
263
264
# File 'lib/xlsxrb/chart_builder.rb', line 262

def fill(*args, **kwargs)
  @options[:fill] = kwargs.empty? ? args.first : kwargs
end

#line(*args, **kwargs) ⇒ Object

Configures line color/thickness for this series.

: (*(Hash[Symbol, String | Integer | bool | nil] | String) args, **String | Integer | bool | nil kwargs) -> (Hash[Symbol, String | Integer | bool | nil] | String)

Parameters:

  • args (Array)

    Positional arguments.

  • kwargs (Hash)

    Keyword arguments.

Returns:

  • (Object)


273
274
275
# File 'lib/xlsxrb/chart_builder.rb', line 273

def line(*args, **kwargs)
  @options[:line] = kwargs.empty? ? args.first : kwargs
end

#marker(*args, **kwargs) ⇒ Object

Configures data markers for this series.

: (*untyped args, **untyped kwargs) -> untyped

Parameters:

  • args (Array)

    Positional arguments.

  • kwargs (Hash)

    Keyword arguments.

Returns:

  • (Object)


251
252
253
# File 'lib/xlsxrb/chart_builder.rb', line 251

def marker(*args, **kwargs)
  @options[:marker] = kwargs.empty? ? args.first : kwargs
end

#name(*args, **kwargs) ⇒ Object

Configures the name for this series (e.g. "Total Sales" or cell reference "Sheet1!$B$1").

: (*untyped args, **untyped kwargs) -> untyped

Parameters:

  • args (Array)

    Positional arguments.

  • kwargs (Hash)

    Keyword arguments.

Returns:

  • (Object)


240
241
242
# File 'lib/xlsxrb/chart_builder.rb', line 240

def name(*args, **kwargs)
  @options[:name] = kwargs.empty? ? args.first : kwargs
end

#shape(*args, **kwargs) ⇒ String

Configures 3D bar/column shape (e.g. "cylinder", "cone", "pyramid").

: (*(String) args, **String | Integer | bool | nil kwargs) -> String

Parameters:

  • args (Array)

    Positional arguments.

  • kwargs (Hash)

    Keyword arguments.

Returns:

  • (String)


317
318
319
# File 'lib/xlsxrb/chart_builder.rb', line 317

def shape(*args, **kwargs)
  @options[:shape] = kwargs.empty? ? args.first : kwargs
end

#smooth(*args, **kwargs) ⇒ Boolean, String

Configures line smoothing for this series.

: (*(bool | String) args, **String | Integer | bool | nil kwargs) -> (bool | String)

Parameters:

  • args (Array)

    Positional arguments.

  • kwargs (Hash)

    Keyword arguments.

Returns:

  • (Boolean, String)


306
307
308
# File 'lib/xlsxrb/chart_builder.rb', line 306

def smooth(*args, **kwargs)
  @options[:smooth] = kwargs.empty? ? args.first : kwargs
end

#trendline(*args, **kwargs) ⇒ Object

Configures trendline for this series.

: (*(Hash[Symbol, String | Integer | bool | nil] | String) args, **String | Integer | bool | nil kwargs) -> (Hash[Symbol, String | Integer | bool | nil] | String)

Parameters:

  • args (Array)

    Positional arguments.

  • kwargs (Hash)

    Keyword arguments.

Returns:

  • (Object)


284
285
286
# File 'lib/xlsxrb/chart_builder.rb', line 284

def trendline(*args, **kwargs)
  @options[:trendline] = kwargs.empty? ? args.first : kwargs
end

#type(*args, **kwargs) ⇒ String

Configures individual series chart type override in combo charts.

: (*(String) args, **String | Integer | bool | nil kwargs) -> String

Parameters:

  • args (Array)

    Positional arguments.

  • kwargs (Hash)

    Keyword arguments.

Returns:

  • (String)


328
329
330
# File 'lib/xlsxrb/chart_builder.rb', line 328

def type(*args, **kwargs)
  @options[:type] = kwargs.empty? ? args.first : kwargs
end

#values(*args, **kwargs) ⇒ Object

Configures values reference for this series (e.g. "Sheet1!$B$2:$B$10").

: (*untyped args, **untyped kwargs) -> untyped

Parameters:

  • args (Array)

    Positional arguments.

  • kwargs (Hash)

    Keyword arguments.

Returns:

  • (Object)


229
230
231
# File 'lib/xlsxrb/chart_builder.rb', line 229

def values(*args, **kwargs)
  @options[:values] = kwargs.empty? ? args.first : kwargs
end