Skip to content

ScatterChart

ScatterChart #

Bases: ConstrainedControl

A scatter chart control.

ScatterChart draws some points in a square space, points are defined by ScatterChartSpots.

animation: ft.AnimationValue = field(default_factory=lambda: ft.Animation(duration=ft.Duration(milliseconds=150), curve=ft.AnimationCurve.LINEAR)) #

Controls chart implicit animation.

Value is of AnimationValue type.

baseline_x: Optional[ft.Number] = None #

The baseline value for X axis.

baseline_y: Optional[ft.Number] = None #

Baseline value for Y axis.

bgcolor: Optional[ft.ColorValue] = None #

The chart's background color.

border: Optional[ft.Border] = None #

The border around the chart.

bottom_axis: ChartAxis = field(default_factory=lambda: ChartAxis()) #

Configures the appearance of the bottom axis, its title and labels.

Value is of type ChartAxis.

handle_built_in_touches: bool = True #

Whether to show a tooltip popup on top of the spots if a touch occurs.

horizontal_grid_lines: Optional[ChartGridLines] = None #

Controls drawing of chart's horizontal lines.

Value is of type ChartGridLines.

interactive: bool = True #

Enables automatic tooltips when hovering chart bars.

left_axis: ChartAxis = field(default_factory=lambda: ChartAxis()) #

Configures the appearance of the left axis, its title and labels.

Value is of type ChartAxis.

long_press_duration: Optional[ft.DurationValue] = None #

The duration of a long press on the chart.

max_x: Optional[ft.Number] = None #

The maximum displayed value for X axis.

max_y: Optional[ft.Number] = None #

The maximum displayed value for Y axis.

min_x: Optional[ft.Number] = None #

The minimum displayed value for X axis.

min_y: Optional[ft.Number] = None #

The minimum displayed value for Y axis.

on_event: ft.OptionalEventHandler[ScatterChartEvent[ScatterChart]] = None #

Fires when an event occurs on the chart.

Event handler receives an instance of ScatterChartEvent.

right_axis: ChartAxis = field(default_factory=lambda: ChartAxis()) #

Configures the appearance of the right axis, its title and labels.

Value is of type ChartAxis.

spots: list[ScatterChartSpot] = field(default_factory=list) #

List of ScatterChartSpots to show on the chart.

tooltip: Optional[ScatterChartTooltip] = None #

The tooltip configuration for the chart.

top_axis: ChartAxis = field(default_factory=lambda: ChartAxis()) #

Configures the appearance of the top axis, its title and labels.

Value is of type ChartAxis.

vertical_grid_lines: Optional[ChartGridLines] = None #

Controls drawing of chart's vertical lines.

Value is of type ChartGridLines.