flet-charts 0.2.0.dev13__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of flet-charts might be problematic. Click here for more details.
- flet_charts/__init__.py +35 -0
- flet_charts/bar_chart.py +237 -0
- flet_charts/bar_chart_group.py +33 -0
- flet_charts/bar_chart_rod.py +111 -0
- flet_charts/bar_chart_rod_stack_item.py +31 -0
- flet_charts/chart_axis.py +64 -0
- flet_charts/line_chart.py +251 -0
- flet_charts/line_chart_data.py +140 -0
- flet_charts/line_chart_data_point.py +85 -0
- flet_charts/matplotlib_chart.py +64 -0
- flet_charts/pie_chart.py +89 -0
- flet_charts/pie_chart_section.py +89 -0
- flet_charts/plotly_chart.py +56 -0
- flet_charts/scatter_chart.py +218 -0
- flet_charts/scatter_chart_spot.py +102 -0
- flet_charts/types.py +288 -0
- flet_charts-0.2.0.dev13.dist-info/METADATA +69 -0
- flet_charts-0.2.0.dev13.dist-info/RECORD +38 -0
- flet_charts-0.2.0.dev13.dist-info/WHEEL +5 -0
- flet_charts-0.2.0.dev13.dist-info/licenses/LICENSE +201 -0
- flet_charts-0.2.0.dev13.dist-info/top_level.txt +2 -0
- flutter/flet_charts/CHANGELOG.md +3 -0
- flutter/flet_charts/LICENSE +201 -0
- flutter/flet_charts/README.md +3 -0
- flutter/flet_charts/analysis_options.yaml +5 -0
- flutter/flet_charts/lib/flet_charts.dart +3 -0
- flutter/flet_charts/lib/src/bar_chart.dart +95 -0
- flutter/flet_charts/lib/src/extension.dart +25 -0
- flutter/flet_charts/lib/src/line_chart.dart +236 -0
- flutter/flet_charts/lib/src/pie_chart.dart +71 -0
- flutter/flet_charts/lib/src/scatter_chart.dart +140 -0
- flutter/flet_charts/lib/src/utils/bar_chart.dart +177 -0
- flutter/flet_charts/lib/src/utils/charts.dart +173 -0
- flutter/flet_charts/lib/src/utils/line_chart.dart +208 -0
- flutter/flet_charts/lib/src/utils/pie_chart.dart +56 -0
- flutter/flet_charts/lib/src/utils/scatter_chart.dart +85 -0
- flutter/flet_charts/pubspec.lock +776 -0
- flutter/flet_charts/pubspec.yaml +24 -0
flet_charts/__init__.py
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
from .bar_chart import (
|
|
2
|
+
BarChart,
|
|
3
|
+
BarChartEvent,
|
|
4
|
+
BarChartTooltip,
|
|
5
|
+
BarChartTooltipDirection,
|
|
6
|
+
)
|
|
7
|
+
from .bar_chart_group import BarChartGroup
|
|
8
|
+
from .bar_chart_rod import BarChartRod, BarChartRodTooltip
|
|
9
|
+
from .bar_chart_rod_stack_item import BarChartRodStackItem
|
|
10
|
+
from .chart_axis import ChartAxis, ChartAxisLabel
|
|
11
|
+
from .line_chart import (
|
|
12
|
+
LineChart,
|
|
13
|
+
LineChartEvent,
|
|
14
|
+
LineChartEventSpot,
|
|
15
|
+
LineChartTooltip,
|
|
16
|
+
)
|
|
17
|
+
from .line_chart_data import LineChartData
|
|
18
|
+
from .line_chart_data_point import LineChartDataPoint, LineChartDataPointTooltip
|
|
19
|
+
from .matplotlib_chart import MatplotlibChart
|
|
20
|
+
from .pie_chart import PieChart, PieChartEvent
|
|
21
|
+
from .pie_chart_section import PieChartSection
|
|
22
|
+
from .plotly_chart import PlotlyChart
|
|
23
|
+
from .scatter_chart import ScatterChart, ScatterChartEvent, ScatterChartTooltip
|
|
24
|
+
from .scatter_chart_spot import ScatterChartSpot, ScatterChartSpotTooltip
|
|
25
|
+
from .types import (
|
|
26
|
+
ChartCirclePoint,
|
|
27
|
+
ChartCrossPoint,
|
|
28
|
+
ChartDataPointTooltip,
|
|
29
|
+
ChartEventType,
|
|
30
|
+
ChartGridLines,
|
|
31
|
+
ChartHorizontalAlignment,
|
|
32
|
+
ChartPointLine,
|
|
33
|
+
ChartPointShape,
|
|
34
|
+
ChartSquarePoint,
|
|
35
|
+
)
|
flet_charts/bar_chart.py
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
from dataclasses import dataclass, field
|
|
2
|
+
from enum import Enum
|
|
3
|
+
from typing import Any, Optional
|
|
4
|
+
|
|
5
|
+
import flet as ft
|
|
6
|
+
|
|
7
|
+
from .bar_chart_group import BarChartGroup
|
|
8
|
+
from .chart_axis import ChartAxis
|
|
9
|
+
from .types import ChartEventType, ChartGridLines
|
|
10
|
+
|
|
11
|
+
__all__ = [
|
|
12
|
+
"BarChart",
|
|
13
|
+
"BarChartEvent",
|
|
14
|
+
"BarChartTooltipDirection",
|
|
15
|
+
"BarChartTooltip",
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class BarChartTooltipDirection(Enum):
|
|
20
|
+
"""Controls showing tooltip on top or bottom."""
|
|
21
|
+
|
|
22
|
+
AUTO = "auto"
|
|
23
|
+
"""Tooltip shows on top if value is positive, on bottom if value is negative."""
|
|
24
|
+
|
|
25
|
+
TOP = "top"
|
|
26
|
+
"""Tooltip always shows on top."""
|
|
27
|
+
|
|
28
|
+
BOTTOM = "bottom"
|
|
29
|
+
"""Tooltip always shows on bottom."""
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@dataclass
|
|
33
|
+
class BarChartTooltip:
|
|
34
|
+
"""Configuration of the tooltip for [`BarChart`][(p).]s."""
|
|
35
|
+
|
|
36
|
+
bgcolor: ft.ColorValue = ft.Colors.SECONDARY
|
|
37
|
+
"""
|
|
38
|
+
Background [color](https://flet.dev/docs/reference/colors) of tooltips.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
border_radius: Optional[ft.BorderRadiusValue] = None
|
|
42
|
+
"""
|
|
43
|
+
The border radius of the tooltip.
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
margin: Optional[ft.Number] = None
|
|
47
|
+
"""
|
|
48
|
+
Applies a bottom margin for showing tooltip on top of rods.
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
padding: Optional[ft.PaddingValue] = None
|
|
52
|
+
"""
|
|
53
|
+
Applies a padding for showing contents inside the tooltip.
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
max_width: Optional[ft.Number] = None
|
|
57
|
+
"""
|
|
58
|
+
Restricts the tooltip's width.
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
rotate_angle: Optional[ft.Number] = None
|
|
62
|
+
"""
|
|
63
|
+
The rotation angle of the tooltip.
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
horizontal_offset: Optional[ft.Number] = None
|
|
67
|
+
"""
|
|
68
|
+
Applies horizontal offset for showing tooltip.
|
|
69
|
+
"""
|
|
70
|
+
|
|
71
|
+
border_side: Optional[ft.BorderSide] = None
|
|
72
|
+
"""
|
|
73
|
+
The tooltip border side.
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
fit_inside_horizontally: Optional[bool] = None
|
|
77
|
+
"""
|
|
78
|
+
Forces the tooltip to shift horizontally inside the chart, if overflow happens.
|
|
79
|
+
|
|
80
|
+
Value is of type `bool`.
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
fit_inside_vertically: Optional[bool] = None
|
|
84
|
+
"""
|
|
85
|
+
Forces the tooltip to shift vertically inside the chart, if overflow happens.
|
|
86
|
+
|
|
87
|
+
Value is of type `bool`.
|
|
88
|
+
"""
|
|
89
|
+
|
|
90
|
+
direction: Optional[BarChartTooltipDirection] = None
|
|
91
|
+
"""
|
|
92
|
+
Controls showing tooltip on top or bottom, default is auto.
|
|
93
|
+
"""
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
@dataclass
|
|
97
|
+
class BarChartEvent(ft.Event["BarChart"]):
|
|
98
|
+
type: ChartEventType
|
|
99
|
+
"""
|
|
100
|
+
The type of event that occurred on the chart.
|
|
101
|
+
"""
|
|
102
|
+
|
|
103
|
+
group_index: Optional[int] = None
|
|
104
|
+
"""
|
|
105
|
+
Bar's index or `-1` if chart is hovered or clicked outside of any bar.
|
|
106
|
+
"""
|
|
107
|
+
|
|
108
|
+
rod_index: Optional[int] = None
|
|
109
|
+
"""
|
|
110
|
+
Rod's index or `-1` if chart is hovered or clicked outside of any bar.
|
|
111
|
+
"""
|
|
112
|
+
|
|
113
|
+
stack_item_index: Optional[int] = None
|
|
114
|
+
"""
|
|
115
|
+
Stack item's index or `-1` if chart is hovered or clicked outside of any bar.
|
|
116
|
+
"""
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
@ft.control("BarChart")
|
|
120
|
+
class BarChart(ft.ConstrainedControl):
|
|
121
|
+
"""
|
|
122
|
+
Draws a bar chart.
|
|
123
|
+
|
|
124
|
+

|
|
125
|
+
"""
|
|
126
|
+
|
|
127
|
+
groups: list[BarChartGroup] = field(default_factory=list)
|
|
128
|
+
"""
|
|
129
|
+
The list of [`BarChartGroup`][(p).]s to draw.
|
|
130
|
+
"""
|
|
131
|
+
|
|
132
|
+
spacing: Optional[ft.Number] = None
|
|
133
|
+
"""
|
|
134
|
+
A amount of space between bar groups.
|
|
135
|
+
"""
|
|
136
|
+
|
|
137
|
+
animation: ft.AnimationValue = field(
|
|
138
|
+
default_factory=lambda: ft.Animation(
|
|
139
|
+
duration=ft.Duration(milliseconds=150), curve=ft.AnimationCurve.LINEAR
|
|
140
|
+
)
|
|
141
|
+
)
|
|
142
|
+
"""
|
|
143
|
+
Controls chart implicit animation.
|
|
144
|
+
|
|
145
|
+
Value is of [`AnimationValue`](https://flet.dev/docs/reference/types/animationvalue)
|
|
146
|
+
type.
|
|
147
|
+
"""
|
|
148
|
+
|
|
149
|
+
interactive: bool = True
|
|
150
|
+
"""
|
|
151
|
+
Enables automatic tooltips when hovering chart bars.
|
|
152
|
+
"""
|
|
153
|
+
|
|
154
|
+
bgcolor: Optional[ft.ColorValue] = None
|
|
155
|
+
"""
|
|
156
|
+
Background [color](https://flet.dev/docs/reference/colors) of the chart.
|
|
157
|
+
"""
|
|
158
|
+
|
|
159
|
+
border: Optional[ft.Border] = None
|
|
160
|
+
"""
|
|
161
|
+
The border around the chart.
|
|
162
|
+
|
|
163
|
+
Value is of type [`Border`](https://flet.dev/docs/reference/types/border).
|
|
164
|
+
"""
|
|
165
|
+
|
|
166
|
+
horizontal_grid_lines: Optional[ChartGridLines] = None
|
|
167
|
+
"""
|
|
168
|
+
Controls drawing of chart's horizontal lines.
|
|
169
|
+
|
|
170
|
+
Value is of type [`ChartGridLines`][(p).].
|
|
171
|
+
"""
|
|
172
|
+
|
|
173
|
+
vertical_grid_lines: Optional[ChartGridLines] = None
|
|
174
|
+
"""
|
|
175
|
+
Controls drawing of chart's vertical lines.
|
|
176
|
+
|
|
177
|
+
Value is of type [`ChartGridLines`][(p).].
|
|
178
|
+
"""
|
|
179
|
+
|
|
180
|
+
left_axis: ChartAxis = field(default_factory=lambda: ChartAxis(label_size=44))
|
|
181
|
+
"""
|
|
182
|
+
The appearance of the left axis, its title and labels.
|
|
183
|
+
|
|
184
|
+
Value is of type [`ChartAxis`][(p).].
|
|
185
|
+
"""
|
|
186
|
+
|
|
187
|
+
top_axis: ChartAxis = field(default_factory=lambda: ChartAxis(label_size=30))
|
|
188
|
+
"""
|
|
189
|
+
The appearance of the top axis, its title and labels.
|
|
190
|
+
|
|
191
|
+
Value is of type [`ChartAxis`][(p).].
|
|
192
|
+
"""
|
|
193
|
+
|
|
194
|
+
right_axis: ChartAxis = field(default_factory=lambda: ChartAxis(label_size=44))
|
|
195
|
+
"""
|
|
196
|
+
The appearance of the right axis, its title and labels.
|
|
197
|
+
|
|
198
|
+
Value is of type [`ChartAxis`][(p).].
|
|
199
|
+
"""
|
|
200
|
+
|
|
201
|
+
bottom_axis: ChartAxis = field(default_factory=lambda: ChartAxis(label_size=30))
|
|
202
|
+
"""
|
|
203
|
+
The appearance of the bottom axis, its title and labels.
|
|
204
|
+
|
|
205
|
+
Value is of type [`ChartAxis`][(p).].
|
|
206
|
+
"""
|
|
207
|
+
|
|
208
|
+
baseline_y: Optional[ft.Number] = None
|
|
209
|
+
"""
|
|
210
|
+
Baseline value for Y axis.
|
|
211
|
+
"""
|
|
212
|
+
|
|
213
|
+
min_y: Optional[ft.Number] = None
|
|
214
|
+
"""
|
|
215
|
+
The minimum displayed value for Y axis.
|
|
216
|
+
"""
|
|
217
|
+
|
|
218
|
+
max_y: Optional[ft.Number] = None
|
|
219
|
+
"""
|
|
220
|
+
The maximum displayed value for Y axis.
|
|
221
|
+
"""
|
|
222
|
+
|
|
223
|
+
tooltip: Optional[BarChartTooltip] = None
|
|
224
|
+
"""
|
|
225
|
+
The tooltip configuration for the chart.
|
|
226
|
+
"""
|
|
227
|
+
|
|
228
|
+
on_event: ft.OptionalEventHandler[BarChartEvent["BarChart"]] = None
|
|
229
|
+
"""
|
|
230
|
+
Fires when a bar is hovered or clicked.
|
|
231
|
+
|
|
232
|
+
Event handler receives an instance of [`BarChartEvent`][(p).].
|
|
233
|
+
"""
|
|
234
|
+
|
|
235
|
+
def __post_init__(self, ref: Optional[ft.Ref[Any]]):
|
|
236
|
+
super().__post_init__(ref)
|
|
237
|
+
self._internals["skip_properties"] = ["tooltip"]
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from dataclasses import field
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
4
|
+
import flet as ft
|
|
5
|
+
|
|
6
|
+
from .bar_chart_rod import BarChartRod
|
|
7
|
+
|
|
8
|
+
__all__ = ["BarChartGroup"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@ft.control("BarChartGroup")
|
|
12
|
+
class BarChartGroup(ft.BaseControl):
|
|
13
|
+
x: int = 0
|
|
14
|
+
"""
|
|
15
|
+
Group position on X axis.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
rods: list[BarChartRod] = field(default_factory=list)
|
|
19
|
+
"""
|
|
20
|
+
The list of [`BarChartRod`][(p).]
|
|
21
|
+
objects to display in the group.
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
group_vertically: bool = False
|
|
25
|
+
"""
|
|
26
|
+
If set to `True` bar rods are drawn on top of each other; otherwise bar rods
|
|
27
|
+
are drawn next to each other.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
spacing: Optional[ft.Number] = None
|
|
31
|
+
"""
|
|
32
|
+
The amount of space between bar rods.
|
|
33
|
+
"""
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
from dataclasses import dataclass, field
|
|
2
|
+
from typing import Any, Optional
|
|
3
|
+
|
|
4
|
+
import flet as ft
|
|
5
|
+
|
|
6
|
+
from .bar_chart_rod_stack_item import BarChartRodStackItem
|
|
7
|
+
from .types import ChartDataPointTooltip
|
|
8
|
+
|
|
9
|
+
__all__ = ["BarChartRod", "BarChartRodTooltip"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@dataclass
|
|
13
|
+
class BarChartRodTooltip(ChartDataPointTooltip):
|
|
14
|
+
"""
|
|
15
|
+
Tooltip configuration for the [`BarChartRod`][(p).].
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
text: Optional[str] = None
|
|
19
|
+
"""
|
|
20
|
+
The text to display in the tooltip.
|
|
21
|
+
|
|
22
|
+
When `None`, defaults to [`BarChartRod.to_y`][(p).].
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@ft.control("BarChartRod")
|
|
27
|
+
class BarChartRod(ft.BaseControl):
|
|
28
|
+
"""A bar rod in a [`BarChartGroup`][(p).]."""
|
|
29
|
+
|
|
30
|
+
stack_items: list[BarChartRodStackItem] = field(default_factory=list)
|
|
31
|
+
"""
|
|
32
|
+
Optional list of [`BarChartRodStackItem`][(p).] objects to draw a stacked bar.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
from_y: ft.Number = 0
|
|
36
|
+
"""
|
|
37
|
+
Specifies a starting position of this rod on Y axis.
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
to_y: Optional[ft.Number] = None
|
|
41
|
+
"""
|
|
42
|
+
Specifies an ending position of this rod on Y axis.
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
width: Optional[ft.Number] = None
|
|
46
|
+
"""
|
|
47
|
+
The width of this rod.
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
color: Optional[ft.ColorValue] = None
|
|
51
|
+
"""
|
|
52
|
+
Rod [color](https://flet.dev/docs/reference/colors).
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
gradient: Optional[ft.Gradient] = None
|
|
56
|
+
"""
|
|
57
|
+
Gradient to draw rod's background.
|
|
58
|
+
|
|
59
|
+
Value is of type [`Gradient`](https://flet.dev/docs/reference/types/gradient).
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
border_radius: Optional[ft.BorderRadiusValue] = None
|
|
63
|
+
"""
|
|
64
|
+
Border radius of a bar rod.
|
|
65
|
+
"""
|
|
66
|
+
|
|
67
|
+
border_side: Optional[ft.BorderSide] = None
|
|
68
|
+
"""
|
|
69
|
+
Border to draw around rod.
|
|
70
|
+
|
|
71
|
+
Value is of type [`BorderSide`](https://flet.dev/docs/reference/types/borderside)
|
|
72
|
+
class.
|
|
73
|
+
"""
|
|
74
|
+
|
|
75
|
+
bg_from_y: Optional[ft.Number] = None
|
|
76
|
+
"""
|
|
77
|
+
An optional starting position of a background behind this rod.
|
|
78
|
+
"""
|
|
79
|
+
|
|
80
|
+
bg_to_y: Optional[ft.Number] = None
|
|
81
|
+
"""
|
|
82
|
+
An optional ending position of a background behind this rod.
|
|
83
|
+
"""
|
|
84
|
+
|
|
85
|
+
bgcolor: Optional[ft.ColorValue] = None
|
|
86
|
+
"""
|
|
87
|
+
An optional [color](https://flet.dev/docs/reference/colors) of a background behind
|
|
88
|
+
this rod.
|
|
89
|
+
"""
|
|
90
|
+
|
|
91
|
+
background_gradient: Optional[ft.Gradient] = None
|
|
92
|
+
"""
|
|
93
|
+
An optional gradient to draw a background with.
|
|
94
|
+
"""
|
|
95
|
+
|
|
96
|
+
selected: bool = False
|
|
97
|
+
"""
|
|
98
|
+
If set to `True` a tooltip is always shown on top of the bar when
|
|
99
|
+
`BarChart.interactive` is set to `False`.
|
|
100
|
+
"""
|
|
101
|
+
|
|
102
|
+
tooltip: BarChartRodTooltip = field(default_factory=lambda: BarChartRodTooltip())
|
|
103
|
+
"""
|
|
104
|
+
The rod's tooltip configuration for this rod.
|
|
105
|
+
"""
|
|
106
|
+
|
|
107
|
+
show_tooltip: bool = True
|
|
108
|
+
"""
|
|
109
|
+
Whether a tooltip should be shown on top of hovered bar.
|
|
110
|
+
"""
|
|
111
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from dataclasses import field
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
4
|
+
import flet as ft
|
|
5
|
+
|
|
6
|
+
__all__ = ["BarChartRodStackItem"]
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@ft.control("BarChartRodStackItem")
|
|
10
|
+
class BarChartRodStackItem(ft.BaseControl):
|
|
11
|
+
from_y: Optional[ft.Number] = None
|
|
12
|
+
"""
|
|
13
|
+
The starting position of this item inside a bar rod.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
to_y: ft.Number = 0
|
|
17
|
+
"""
|
|
18
|
+
The ending position of this item inside a bar rod.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
color: Optional[ft.ColorValue] = None
|
|
22
|
+
"""
|
|
23
|
+
The [color](https://flet.dev/docs/reference/colors) of this item.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
border_side: ft.BorderSide = field(default_factory=lambda: ft.BorderSide.none())
|
|
27
|
+
"""
|
|
28
|
+
A border around this item.
|
|
29
|
+
|
|
30
|
+
Value is of type [`BorderSide`](https://flet.dev/docs/reference/types/borderside).
|
|
31
|
+
"""
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
from dataclasses import field
|
|
2
|
+
from typing import Optional, Union
|
|
3
|
+
|
|
4
|
+
import flet as ft
|
|
5
|
+
|
|
6
|
+
__all__ = ["ChartAxis", "ChartAxisLabel"]
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@ft.control("ChartAxisLabel")
|
|
10
|
+
class ChartAxisLabel(ft.BaseControl):
|
|
11
|
+
"""
|
|
12
|
+
Configures a custom label for specific value.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
value: Optional[ft.Number] = None
|
|
16
|
+
"""
|
|
17
|
+
A value to draw label for.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
label: Optional[Union[ft.Control, str]] = None
|
|
21
|
+
"""
|
|
22
|
+
The label to display for the specified `value`.
|
|
23
|
+
|
|
24
|
+
Can be a string or a `Control`.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@ft.control("ChartAxis")
|
|
29
|
+
class ChartAxis(ft.BaseControl):
|
|
30
|
+
"""
|
|
31
|
+
Configures chart axis.
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
title: Optional[ft.Control] = None
|
|
35
|
+
"""
|
|
36
|
+
A `Control` to display as axis title.
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
title_size: ft.Number = 16
|
|
40
|
+
"""
|
|
41
|
+
Width or height of title area.
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
show_labels: bool = True
|
|
45
|
+
"""
|
|
46
|
+
Whether to display the `labels` along the axis.
|
|
47
|
+
If `labels` is empty then automatic labels are displayed.
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
labels: list[ChartAxisLabel] = field(default_factory=list)
|
|
51
|
+
"""
|
|
52
|
+
The list of [`ChartAxisLabel`][(p).]
|
|
53
|
+
objects to set custom axis labels for only specific values.
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
label_spacing: Optional[ft.Number] = None
|
|
57
|
+
"""
|
|
58
|
+
The interval between automatic labels.
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
label_size: ft.Number = 22
|
|
62
|
+
"""
|
|
63
|
+
Width or height of labels area.
|
|
64
|
+
"""
|