-
Notifications
You must be signed in to change notification settings - Fork 654
Expand file tree
/
Copy pathexample_1.py
More file actions
61 lines (55 loc) · 2.08 KB
/
example_1.py
File metadata and controls
61 lines (55 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import flet as ft
import flet_charts as fch
def main(page: ft.Page):
page.title = "Radar chart"
page.padding = 20
page.vertical_alignment = page.horizontal_alignment = "center"
page.theme_mode = ft.ThemeMode.LIGHT
categories = ["macOS", "Linux", "Windows"]
page.add(
fch.RadarChart(
expand=True,
titles=[fch.RadarChartTitle(text=label) for label in categories],
center_min_value=True,
tick_count=4,
ticks_text_style=ft.TextStyle(size=20, color=ft.Colors.ON_SURFACE),
title_text_style=ft.TextStyle(
size=24, weight=ft.FontWeight.BOLD, color=ft.Colors.ON_SURFACE
),
on_event=lambda e: print(e.type),
data_sets=[
fch.RadarDataSet(
fill_color=ft.Colors.with_opacity(0.2, ft.Colors.DEEP_PURPLE),
border_color=ft.Colors.DEEP_PURPLE,
entry_radius=4,
entries=[
fch.RadarDataSetEntry(300),
fch.RadarDataSetEntry(50),
fch.RadarDataSetEntry(250),
],
),
fch.RadarDataSet(
fill_color=ft.Colors.with_opacity(0.15, ft.Colors.PINK),
border_color=ft.Colors.PINK,
entry_radius=4,
entries=[
fch.RadarDataSetEntry(250),
fch.RadarDataSetEntry(100),
fch.RadarDataSetEntry(200),
],
),
fch.RadarDataSet(
fill_color=ft.Colors.with_opacity(0.12, ft.Colors.CYAN),
border_color=ft.Colors.CYAN,
entry_radius=4,
entries=[
fch.RadarDataSetEntry(200),
fch.RadarDataSetEntry(150),
fch.RadarDataSetEntry(50),
],
),
],
)
)
if __name__ == "__main__":
ft.run(main)