Bar Chart

A Callable for generating a bar chart.

Definition

class controller.callable.outputter.BarChart(self, x: ColumnReference, y: ColumnReference, title: str, x_axis_name: str, y_axis_name: str)
Callable name:

bar_chart

Callable type:

Outputter

Parameters:
  • x (ColumnReference) – A column reference to find values for the x-axis.

  • y (ColumnReference) – A column reference to find values for the y-axis.

  • title (str) – The title of the chart.

  • x_axis_name (str) – The name of the x-axis.

  • y_axis_name (str) – The name of the y-axis.

Parameters

x

A column reference to find values for the x-axis.

Type:

ColumnReference

Required:

True

Choices:

All columns in the target DataFrame

y

A column reference to find values for the y-axis.

Type:

ColumnReference

Required:

True

Choices:

All columns in the target DataFrame

title

The title of the chart.

Type:

str

Required:

True

x_axis_name

The name of the x-axis.

Type:

str

Required:

True

y_axis_name

The name of the y-axis.

Type:

str

Required:

True

Output

A DataFrame is returned where it contains two columns matching the output conventions of an Outputter.

  • The data column contains the generated bar chart in PNG format.

  • The type column indicates the data type to be image/png.

Example configuration

{
    "name": "foo",
    "callable": "bar_chart",
    "params": {
        "x": "$get_courses.courses.course_id",
        "y": "$final_exam_means.means",
        "title": "Final Exam Means",
        "x_axis_name": "Course ID",
        "y_axis_name": "Mean"
    }
}