Podium.Chart.XyChartData (Podium v0.3.0)

Copy Markdown View Source

XY (scatter) chart data with numeric X and Y value pairs per series.

Unlike Podium.Chart.ChartData, scatter charts don't use named categories. Each series has its own set of X values paired with Y values.

Example

alias Podium.Chart.XyChartData

data =
  XyChartData.new()
  |> XyChartData.add_series("Observations", [1.0, 2.5, 3.2, 4.8], [5.3, 7.1, 4.9, 8.2],
    color: "4472C4"
  )

See the Charts guide for full documentation.

Summary

Functions

Adds a scatter series with paired X and Y values.

Creates a new empty XyChartData.

Returns the Excel cell reference for a series name.

Returns the Excel range reference for a series' X values.

Returns the Excel range reference for a series' Y values.

Types

t()

@type t() :: %Podium.Chart.XyChartData{series: [Series.t()]}

Functions

add_series(data, name, x_values, y_values, opts \\ [])

@spec add_series(t(), String.t(), [number()], [number()], keyword()) :: t()

Adds a scatter series with paired X and Y values.

Options

  • :color - series color (hex RGB string)
  • :pattern - pattern fill keyword list
  • :marker - marker options keyword list
  • :point_colors - %{index => color} map for per-point colors
  • :point_formats - %{index => opts} map for per-point formatting
  • :data_labels - %{index => opts} map for per-point data labels

new()

@spec new() :: t()

Creates a new empty XyChartData.

series_name_ref(xy_chart_data, series)

@spec series_name_ref(t(), Podium.Chart.XyChartData.Series.t()) :: String.t()

Returns the Excel cell reference for a series name.

series_x_values_ref(xy_chart_data, series)

@spec series_x_values_ref(t(), Podium.Chart.XyChartData.Series.t()) :: String.t()

Returns the Excel range reference for a series' X values.

series_y_values_ref(xy_chart_data, series)

@spec series_y_values_ref(t(), Podium.Chart.XyChartData.Series.t()) :: String.t()

Returns the Excel range reference for a series' Y values.