class Axlsx::LineChart

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


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 =
ws = p.workbook.add_worksheet
ws.add_row ["This is a chart with no data in the sheet"]

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

Creates a new line chart object


  • frame (GraphicFrame)

    The workbook that owns this chart.

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

    a customizable set of options

Options Hash (options):

  • title (Cell, String)
  • show_legend (Boolean)
  • grouping (Symbol)

The axes for this chart. LineCharts have a category and value axis.

the category axis

The node name to use in serialization. As LineChart is used as the base class for Liine3DChart we need to be sure to serialize the chart based on the actual class type and not a fixed node name.

Serializes the object


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

the category axis

LineChart is referenced in 0 repositories