Category-based chart data for column, bar, line, pie, area, doughnut, and radar charts.
Build chart data by creating a new struct, adding categories, then adding one or more named series with values that correspond to the categories.
Example
alias Podium.Chart.ChartData
chart_data =
ChartData.new()
|> ChartData.add_categories(["Q1", "Q2", "Q3", "Q4"])
|> ChartData.add_series("Revenue", [12_500, 14_600, 15_200, 18_100], color: "4472C4")
|> ChartData.add_series("Expenses", [10_000, 11_500, 12_000, 13_200], color: "ED7D31")See the Charts guide for full documentation.
Summary
Functions
Adds categories to the chart data.
Adds a series with a name and numeric values.
Returns the Excel worksheet reference for the categories range. e.g. "Sheet1!$A$2:$A$5" for 4 categories.
Converts a 1-based column number to an Excel column letter. 1 -> "B", 2 -> "C", etc. (offset by 1 because column A is categories)
Creates a new empty ChartData.
Returns the Excel worksheet reference for a series name cell. e.g. "Sheet1!$B$1" for series index 0.
Returns the Excel worksheet reference for a series values range. e.g. "Sheet1!$B$2:$B$5" for series index 0 with 4 values.
Types
@type t() :: %Podium.Chart.ChartData{categories: [String.t()], series: [Series.t()]}
Functions
Adds categories to the chart data.
Adds a series with a name and numeric values.
Returns the Excel worksheet reference for the categories range. e.g. "Sheet1!$A$2:$A$5" for 4 categories.
@spec column_letter(pos_integer()) :: String.t()
Converts a 1-based column number to an Excel column letter. 1 -> "B", 2 -> "C", etc. (offset by 1 because column A is categories)
@spec new() :: t()
Creates a new empty ChartData.
Returns the Excel worksheet reference for a series name cell. e.g. "Sheet1!$B$1" for series index 0.
Returns the Excel worksheet reference for a series values range. e.g. "Sheet1!$B$2:$B$5" for series index 0 with 4 values.