Description

class Axlsx::Chart
Note:

Worksheet#add_chart is the recommended way to create charts for your worksheets.

A Chart is the superclass for specific charts

Creates a new chart object

Parameters:

  • frame (GraphicalFrame)

    The frame that holds this chart.

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

    a customizable set of options

Options Hash (options):

  • title (Cell, String)
  • show_legend (Boolean)
  • legend_position (Symbol)
  • start_at (Array|String|Cell)

    The X, Y coordinates defining the top left corner of the chart.

  • end_at (Array|String|Cell)

    The X, Y coordinates defining the bottom right corner of the chart.

Yields:

  • (_self)

Yield Parameters:

  • _self (Axlsx::Chart)

    the object that the method was called on

Adds a new series to the chart's series collection.

Background color for the chart

TODO data labels!

How to display blank values Options are

  • gap: Display nothing

  • span: Not sure what this does

  • zero: Display as if the value were zero, not blank

Default :gap (although this really should vary by chart type and grouping)

This is a short cut method to set the end anchor position If you need finer granularity in positioning use graphic_frame.anchor.to.colOff / rowOff

Parameters:

  • x (Integer) (defaults to: 10)

    The column - default 10

  • y (Integer) (defaults to: 10)

    The row - default 10

Note:

This will be disconinued in version 2.0.0. please use the start_at method

backwards compatibility to allow chart.to and chart.from access to anchor markers

A reference to the graphic frame that owns this chart

The index of this chart in the workbooks charts collection

Note:

The following are allowed

:b
:l
:r
:t
:tr

Set the location of the chart's legend

The part name for this chart

The relationship object for this chart.

A collection of series objects that are applied to the chart

The type of series to use for this chart.

Show the legend in the chart

This is a short cut method to set the anchor start marker position If you need finer granularity in positioning use

This helper method acceps a fairly wide range of inputs exampled below

reference or cell to use in setting the start marker position.

Examples:


start_at 0, 5 # The anchor start marker is set to 6th row of
the first column

start_at [0, 5] # The anchor start marker is set to start on the 6th row
of the first column

start_at "C1" # The anchor start marker is set to start on the first row
of the third column

start_at sheet.rows.first.cells.last # The anchor start
marker is set to the location of a specific cell.

Parameters:

  • x (Array|String|Cell) (defaults to: 0)

    the column, coordinates, string

  • y (Integer) (defaults to: 0)

    The row

The style for the chart. see ECMA Part 1 §21.2.2.196

The title object for the chart.

Note:

This will be disconinued in version 2.0.0. Please use the end_at method

backwards compatibility to allow chart.to and chart.from access to anchor markers

Serializes the object

Parameters:

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

Indicates that colors should be varied by datum

The 3D view properties for the chart

Chart is referenced in 0 repositories