Skip to content

PieChartSection

Inherits: BaseControl

Configures a PieChart section.

Properties

  • badge(Control | None) –

    An optional Control drawn in the middle of a section.

  • badge_position(Number | None) –

    The position/offset of the badge relative to the section's center.

  • border_side(BorderSide) –

    The border around section shape.

  • color(ColorValue | None) –

    Background color of the section.

  • gradient(Gradient | None) –

    Defines the gradient of section. If specified, overrides the color setting.

  • radius(Number | None) –

    External radius of the section.

  • title(str | None) –

    A title drawn at the center of the section.

  • title_position(Number | None) –

    The position/offset of the title relative to the section's center.

  • title_style(TextStyle | None) –

    The style to draw title with.

  • value(Number) –

    Determines how much the section should occupy. This depends on sum of all sections,

Properties#

badge #

badge: Control | None = None

An optional Control drawn in the middle of a section.

badge_position #

badge_position: Number | None = None

The position/offset of the badge relative to the section's center.

  • 0.0: near the center
  • 1.0: near the outside of the chart

By default the badge is drawn in the middle of the section.

Raises:

  • ValueError

    If it is not between 0.0 and 1.0 inclusive.

border_side #

border_side: BorderSide = field(
    default_factory=lambda: none()
)

The border around section shape.

color #

color: ColorValue | None = None

Background color of the section.

gradient #

gradient: Gradient | None = None

Defines the gradient of section. If specified, overrides the color setting.

radius #

radius: Number | None = None

External radius of the section.

title #

title: str | None = None

A title drawn at the center of the section.

title_position #

title_position: Number | None = None

The position/offset of the title relative to the section's center.

  • 0.0: near the center
  • 1.0: near the outside of the chart

By default the title is drawn in the middle of the section.

Raises:

  • ValueError

    If it is not between 0.0 and 1.0 inclusive.

title_style #

title_style: TextStyle | None = None

The style to draw title with.

value #

value: Number

Determines how much the section should occupy. This depends on sum of all sections, each section should occupy (value / sum of all values) * 360 degrees.