flet
flet copied to clipboard
Pi Chart disappears when scroll mode is set to auto or adaptive
Duplicate Check
- [x] I have searched the opened issues and there are no duplicates
Describe the bug
Pi Chart disappears when scroll mode is set to auto or adaptive
Code
import flet as ft
def main(page: ft.Page):
page.scroll = "auto"
normal_border = ft.BorderSide(0, ft.colors.with_opacity(0, ft.colors.WHITE))
hovered_border = ft.BorderSide(6, ft.colors.WHITE)
def on_chart_event(e: ft.PieChartEvent):
for idx, section in enumerate(chart.sections):
section.border_side = (
hovered_border if idx == e.section_index else normal_border
)
chart.update()
chart = ft.PieChart(
sections=[
ft.PieChartSection(
25,
color=ft.colors.BLUE,
radius=80,
border_side=normal_border,
),
ft.PieChartSection(
25,
color=ft.colors.YELLOW,
radius=65,
border_side=normal_border,
),
ft.PieChartSection(
25,
color=ft.colors.PINK,
radius=60,
border_side=normal_border,
),
ft.PieChartSection(
25,
color=ft.colors.GREEN,
radius=70,
border_side=normal_border,
),
],
sections_space=1,
center_space_radius=0,
on_chart_event=on_chart_event,
expand=True,
)
page.add(chart)
ft.app(main)
To reproduce
1 Run code above => Pi chart has disappeared 2. Remove page.scroll = "auto" line => pi chart appears
Expected behavior
Pi Chart renders properly when scroll mode is set
Screenshots
No response
Operating System
Linux
Operating system details
fedora
Flet version
0.23.1
Regression
No, it isn't
Suggestions
No response
Additional details
No response