Skip to content

ChartAxis

ChartAxis #

Bases: BaseControl

Configures chart axis.

data #

data: Any = skip_field()

Arbitrary data of any type that can be attached to a control.

key #

key: (
    str | int | float | bool | ValueKey | ScrollKey | None
) = None

label_size #

label_size: Number = 22

Width or height of labels area.

label_spacing #

label_spacing: Number | None = None

The interval between automatic labels.

labels #

labels: list[ChartAxisLabel] = field(default_factory=list)

The list of ChartAxisLabel objects to set custom axis labels for only specific values.

page #

page: Page | PageView | None

The page (of type Page or PageView) to which this control belongs to.

parent #

parent: BaseControl | None

The direct ancestor(parent) of this control.

It defaults to None and will only have a value when this control is mounted (added to the page tree).

The Page control (which is the root of the tree) is an exception - it always has parent=None.

show_labels #

show_labels: bool = True

Whether to display the labels along the axis. If labels is empty then automatic labels are displayed.

title #

title: Control | None = None

A Control to display as axis title.

title_size #

title_size: Number = 16

Width or height of title area.

before_event #

before_event(e: ControlEvent)

before_update #

before_update()

before_update() method is called every time when the control is being updated. Make sure not to call update() method within before_update().

did_mount #

did_mount()

init #

init()

is_isolated #

is_isolated()

update #

update() -> None

will_unmount #

will_unmount()