endstone.metrics.charts

Modules

Classes

classAdvancedBarChart

Bases: CustomChart

AdvancedBarChart(chart_id: str, get_values: Callable[[], Dict[str, List[int]] | None])

Parameters

NameTypeDescriptionDefault
chart_idstr

The id of the chart.

required
get_valuesCallable[[], Dict[str, List[int]] | None]

The callable which is used to request the chart data.

required

Methods

NameDescription
get_chart_data

Gets the data for the advanced bar chart.

Attributes

NameTypeDescription
get_values

attrget_values

get_values

methget_chart_data

get_chart_data() -> dict | None

Gets the data for the advanced bar chart.

Returns

TypeDescription
dict | None

dict | None: A dictionary with the chart data.

classAdvancedPie

Bases: CustomChart

AdvancedPie(chart_id: str, get_values: Callable[[], dict[str, int] | None])

Parameters

NameTypeDescriptionDefault
chart_idstr

The id of the chart.

required
get_valuesCallable[[], dict[str, int] | None]

The callable which is used to request the chart data.

required

Methods

NameDescription
get_chart_data

Gets the data for the advanced pie chart.

Attributes

NameTypeDescription
get_values

attrget_values

get_values

methget_chart_data

get_chart_data() -> dict | None

Gets the data for the advanced pie chart.

Returns

TypeDescription
dict | None

dict | None: A dictionary with the chart data.

classCustomChart

Bases: ABC

CustomChart(chart_id: str)

Represents a custom chart.

Parameters

NameTypeDescriptionDefault
chart_idstr

The id of the chart.

required

Raises

TypeDescription
ValueError

If chart_id is None or empty.

Methods

NameDescription
get_chart_data

Gets the data for the chart.

Attributes

NameTypeDescription
chart_id

attrchart_id

chart_id

methget_chart_dataabstractmethod

get_chart_data() -> dict | None

Gets the data for the chart.

Returns

NameTypeDescription
dictdict | None

A dictionary with the chart data.

Raises

TypeDescription
Exception

If there is an error getting the chart data.

classDrilldownPie

Bases: CustomChart

DrilldownPie(chart_id: str, get_values: Callable[[], Dict[str, Dict[str, int]] | None])

Parameters

NameTypeDescriptionDefault
chart_idstr

The id of the chart.

required
get_valuesCallable[[], Dict[str, Dict[str, int]] | None]

The callable which is used to request the chart data.

required

Methods

NameDescription
get_chart_data

Gets the data for the advanced pie chart.

Attributes

NameTypeDescription
get_values

attrget_values

get_values

methget_chart_data

get_chart_data() -> dict | None

Gets the data for the advanced pie chart.

Returns

TypeDescription
dict | None

dict | None: A dictionary with the chart data.

classMultiLineChart

Bases: CustomChart

MultiLineChart(chart_id: str, get_values: Callable[[], Dict[str, int] | None])

Parameters

NameTypeDescriptionDefault
chart_idstr

The id of the chart.

required
get_valuesCallable[[], Dict[str, int] | None]

The callable which is used to request the chart data.

required

Methods

NameDescription
get_chart_data

Gets the data for the multi-line chart.

Attributes

NameTypeDescription
get_values

attrget_values

get_values

methget_chart_data

get_chart_data() -> dict | None

Gets the data for the multi-line chart.

Returns

TypeDescription
dict | None

dict | None: A dictionary with the chart data.

classSimpleBarChart

Bases: CustomChart

SimpleBarChart(chart_id: str, get_values: Callable[[], Dict[str, int] | None])

Parameters

NameTypeDescriptionDefault
chart_idstr

The id of the chart.

required
get_valuesCallable[[], Dict[str, int] | None]

The callable which is used to request the chart data.

required

Methods

NameDescription
get_chart_data

Gets the data for the simple bar chart.

Attributes

NameTypeDescription
get_values

attrget_values

get_values

methget_chart_data

get_chart_data() -> dict | None

Gets the data for the simple bar chart.

Returns

TypeDescription
dict | None

dict | None: A dictionary with the chart data.

classSimplePie

Bases: CustomChart

SimplePie(chart_id: str, get_value: Callable[[], str | None])

Parameters

NameTypeDescriptionDefault
chart_idstr

The id of the chart.

required
get_valueCallable[[], str | None]

The callable which is used to request the chart data.

required

Methods

NameDescription
get_chart_data

Gets the data for the simple pie chart.

Attributes

NameTypeDescription
get_value

attrget_value

get_value

methget_chart_data

get_chart_data() -> dict | None

Gets the data for the simple pie chart.

Returns

TypeDescription
dict | None

dict | None: A dictionary with the chart data.

classSingleLineChart

Bases: CustomChart

SingleLineChart(chart_id: str, get_value: Callable[[], int])

Parameters

NameTypeDescriptionDefault
chart_idstr

The id of the chart.

required
get_valueCallable[[], int]

The callable which is used to request the chart data.

required

Methods

NameDescription
get_chart_data

Gets the data for the simple pie chart.

Attributes

NameTypeDescription
get_value

attrget_value

get_value

methget_chart_data

get_chart_data() -> dict | None

Gets the data for the simple pie chart.

Returns

TypeDescription
dict | None

dict | None: A dictionary with the chart data.

On this page