Class: Axlsx::Line3DChart

Inherits:
LineChart show all
Defined in:
lib/axlsx/drawing/line_3D_chart.rb

Overview

The Line3DChart is a three dimentional line chart (who would have guessed?) that you can add to your worksheet.

Examples:

Creating a chart

# This example creates a line in a single sheet.
require "rubygems" # if that is your preferred way to manage gems!
require "axlsx"

p = Axlsx::Package.new
ws = p.workbook.add_worksheet
ws.add_row ["This is a chart with no data in the sheet"]

chart = ws.add_chart(Axlsx::Line3DChart, :start_at=> [0,1], :end_at=>[0,6], :t#itle=>"Most Popular Pets")
chart.add_series :data => [1, 9, 10], :labels => ["Slimy Reptiles", "Fuzzy Bunnies", "Rottweiler"]

See Also:

Constant Summary collapse

GAP_AMOUNT_PERCENT =

validation regex for gap amount percent

/0*(([0-9])|([1-9][0-9])|([1-4][0-9][0-9])|500)%/.freeze

Instance Attribute Summary collapse

Attributes inherited from LineChart

#grouping

Attributes inherited from Chart

#bg_color, #display_blanks_as, #graphic_frame, #legend_position, #plot_visible_only, #rounded_corners, #series, #series_type, #show_legend, #style, #title, #vary_colors, #view_3D

Instance Method Summary collapse

Methods inherited from LineChart

#axes, #cat_axis, #node_name, #val_axis

Methods inherited from Chart

#add_series, #d_lbls, #end_at, #from, #index, #pn, #relationship, #start_at, #title_size=, #to

Methods included from OptionsParser

#parse_options

Constructor Details

#initialize(frame, options = {}) ⇒ Line3DChart

Creates a new line chart object

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • gap_depth (String)

See Also:



43
44
45
46
47
48
# File 'lib/axlsx/drawing/line_3D_chart.rb', line 43

def initialize(frame, options = {})
  @gap_depth = nil
  @view_3D = View3D.new({ r_ang_ax: 1 }.merge(options))
  super(frame, options)
  axes.add_axis :ser_axis, SerAxis
end

Instance Attribute Details

#gap_depthString Also known as: gapDepth

space between bar or column clusters, as a percentage of the bar or column width.

Returns:

  • (String)


25
26
27
# File 'lib/axlsx/drawing/line_3D_chart.rb', line 25

def gap_depth
  @gap_depth
end

Instance Method Details

#ser_axisAxis Also known as: serAxis

the category axis

Returns:



33
34
35
# File 'lib/axlsx/drawing/line_3D_chart.rb', line 33

def ser_axis
  axes[:ser_axis]
end

#to_xml_string(str = +'')) ⇒ String

Serializes the object

Parameters:

  • str (String) (defaults to: +''))

Returns:

  • (String)


60
61
62
63
64
# File 'lib/axlsx/drawing/line_3D_chart.rb', line 60

def to_xml_string(str = +'')
  super(str) do
    str << '<c:gapDepth val="' << @gap_depth.to_s << '"/>' unless @gap_depth.nil?
  end
end