Podium.Chart (Podium v0.3.0)

Copy Markdown View Source

Chart struct and XML generation for embedding charts in slides.

A chart combines a chart type, chart data, and formatting options (title, legend, axes, data labels). The chart XML is generated by Podium.Chart.XmlWriter and the embedded Excel workbook by Podium.Chart.XlsxWriter.

Summary

Functions

Generates the graphic frame XML for embedding the chart in a slide. The shape_id is the shape ID within the slide, and r_id is the relationship ID linking to the chart part.

Creates a new chart.

Creates a new combo chart.

Returns the partname for the chart XML.

Returns the rels partname for this chart.

Returns the partname for the embedded Excel workbook.

Types

t()

@type t() :: %Podium.Chart{
  category_axis: keyword(),
  chart_data: struct(),
  chart_index: pos_integer() | nil,
  chart_type: Podium.chart_type() | :combo,
  combo: Podium.Chart.ComboChart.t() | nil,
  data_labels: keyword() | [atom()],
  height: non_neg_integer(),
  legend: atom() | keyword() | false | nil,
  secondary_value_axis: keyword(),
  title: String.t() | keyword() | nil,
  value_axis: keyword(),
  width: non_neg_integer(),
  x: non_neg_integer(),
  y: non_neg_integer()
}

Functions

graphic_frame_xml(chart, shape_id, r_id)

@spec graphic_frame_xml(t(), pos_integer(), String.t()) :: String.t()

Generates the graphic frame XML for embedding the chart in a slide. The shape_id is the shape ID within the slide, and r_id is the relationship ID linking to the chart part.

new(chart_type, chart_data, opts)

@spec new(atom(), struct(), keyword()) :: t()

Creates a new chart.

new_combo(combo, opts)

@spec new_combo(
  Podium.Chart.ComboChart.t(),
  keyword()
) :: t()

Creates a new combo chart.

partname(chart)

@spec partname(t()) :: String.t()

Returns the partname for the chart XML.

rels_partname(chart)

@spec rels_partname(t()) :: String.t()

Returns the rels partname for this chart.

xlsx_partname(chart)

@spec xlsx_partname(t()) :: String.t()

Returns the partname for the embedded Excel workbook.