Pane

class Pane(chart, pane_index: int)

Pane is a Python wrapper around LWC’s IPaneApi. It represents a single chart pane and provides methods for resizing, reordering, and introspecting that pane.

Instances are created by calling chart.panes() — do not instantiate directly.

Stale instances: Pane objects become stale after structural pane changes such as remove_pane() or swap_panes(). Re-call chart.panes() after such operations.


get_height() int

Returns the pane height in pixels (blocking call).


set_height(height: int)

Sets the pane height in pixels.


get_stretch_factor() float

Returns the relative height factor of this pane (blocking call).


set_stretch_factor(factor: float)

Sets the relative height factor for this pane.


move_to(pane_index: int)

Reorders this pane to the given index.


pane_index() int

Returns the current pane index (uses cached value).


get_series() list

Returns the list of SeriesCommon objects on this pane that are tracked in the parent chart’s series registry.


attach_primitive(js_constructor_call: str) AttachedPanePrimitive

Attaches a JavaScript primitive at the pane level. The primitive must implement LWC’s IPanePrimitive interface.

Returns an AttachedPanePrimitive instance with a .detach() method.


detach_primitive(primitive: AttachedPanePrimitive)

Detaches a previously attached pane primitive.


set_preserve_empty_pane(preserve: bool)

Sets whether this pane is preserved when all its series are removed.


preserve_empty_pane() bool

Returns whether the empty-pane preservation flag is set (blocking call).

Pane management on AbstractChart

The following methods on AbstractChart manage panes:

add_pane(height: int)

Adds a new pane to the chart. Optionally specify height in pixels.


get_pane_count() int

Returns the current number of panes in the chart (blocking call).


panes() list

Returns a list of Pane objects, one per pane. The list is rebuilt on each call.


resize_pane(pane_index: int, height: int)

Resizes the pane at pane_index to height pixels.


remove_pane(pane_index: int)

Removes the pane at pane_index.


swap_panes(first: int, second: int)

Swaps the panes at indices first and second.