flet-charts 0.2.0.dev35__py3-none-any.whl → 0.2.0.dev84__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 +24 -17
- flet_charts/bar_chart.py +83 -23
- flet_charts/bar_chart_group.py +1 -1
- flet_charts/bar_chart_rod.py +36 -4
- flet_charts/chart_axis.py +29 -9
- flet_charts/line_chart.py +72 -7
- flet_charts/line_chart_data.py +30 -4
- flet_charts/line_chart_data_point.py +32 -2
- flet_charts/matplotlib_chart.py +2 -1
- flet_charts/pie_chart.py +3 -3
- flet_charts/pie_chart_section.py +5 -0
- flet_charts/scatter_chart.py +70 -23
- flet_charts/scatter_chart_spot.py +43 -4
- flet_charts/types.py +159 -16
- {flet_charts-0.2.0.dev35.dist-info → flet_charts-0.2.0.dev84.dist-info}/METADATA +8 -9
- flet_charts-0.2.0.dev84.dist-info/RECORD +38 -0
- flutter/flet_charts/lib/src/bar_chart.dart +2 -0
- flutter/flet_charts/lib/src/scatter_chart.dart +22 -21
- flutter/flet_charts/lib/src/utils/bar_chart.dart +26 -9
- flutter/flet_charts/lib/src/utils/charts.dart +12 -0
- flutter/flet_charts/lib/src/utils/line_chart.dart +15 -3
- flutter/flet_charts/lib/src/utils/pie_chart.dart +1 -0
- flutter/flet_charts/lib/src/utils/scatter_chart.dart +22 -21
- flutter/flet_charts/pubspec.lock +48 -32
- flet_charts-0.2.0.dev35.dist-info/RECORD +0 -38
- {flet_charts-0.2.0.dev35.dist-info → flet_charts-0.2.0.dev84.dist-info}/WHEEL +0 -0
- {flet_charts-0.2.0.dev35.dist-info → flet_charts-0.2.0.dev84.dist-info}/licenses/LICENSE +0 -0
- {flet_charts-0.2.0.dev35.dist-info → flet_charts-0.2.0.dev84.dist-info}/top_level.txt +0 -0
flet_charts/pie_chart_section.py
CHANGED
|
@@ -74,6 +74,11 @@ class PieChartSection(ft.BaseControl):
|
|
|
74
74
|
and `1.0`(near the outside of the chart) inclusive.
|
|
75
75
|
"""
|
|
76
76
|
|
|
77
|
+
gradient: Optional[ft.Gradient] = None
|
|
78
|
+
"""
|
|
79
|
+
Defines the gradient of section. If specified, overrides the color setting.
|
|
80
|
+
"""
|
|
81
|
+
|
|
77
82
|
def before_update(self):
|
|
78
83
|
super().before_update()
|
|
79
84
|
assert self.title_position is None or (0.0 <= self.title_position <= 1.0), (
|
flet_charts/scatter_chart.py
CHANGED
|
@@ -3,9 +3,9 @@ from typing import Any, Optional
|
|
|
3
3
|
|
|
4
4
|
import flet as ft
|
|
5
5
|
|
|
6
|
-
from .chart_axis import ChartAxis
|
|
7
|
-
from .scatter_chart_spot import ScatterChartSpot
|
|
8
|
-
from .types import ChartEventType, ChartGridLines,
|
|
6
|
+
from flet_charts.chart_axis import ChartAxis
|
|
7
|
+
from flet_charts.scatter_chart_spot import ScatterChartSpot
|
|
8
|
+
from flet_charts.types import ChartEventType, ChartGridLines, HorizontalAlignment
|
|
9
9
|
|
|
10
10
|
__all__ = ["ScatterChart", "ScatterChartEvent", "ScatterChartTooltip"]
|
|
11
11
|
|
|
@@ -24,57 +24,99 @@ class ScatterChartTooltip:
|
|
|
24
24
|
The tooltip's border radius.
|
|
25
25
|
"""
|
|
26
26
|
|
|
27
|
-
padding:
|
|
27
|
+
padding: ft.PaddingValue = field(
|
|
28
|
+
default_factory=lambda: ft.Padding.symmetric(vertical=8, horizontal=16)
|
|
29
|
+
)
|
|
28
30
|
"""
|
|
29
31
|
Applies a padding for showing contents inside the tooltip.
|
|
30
32
|
"""
|
|
31
33
|
|
|
32
|
-
max_width:
|
|
34
|
+
max_width: ft.Number = 120
|
|
33
35
|
"""
|
|
34
36
|
Restricts the tooltip's width.
|
|
35
37
|
"""
|
|
36
38
|
|
|
37
|
-
|
|
39
|
+
rotation: ft.Number = 0.0
|
|
38
40
|
"""
|
|
39
41
|
The tooltip's rotation angle in degrees.
|
|
40
42
|
"""
|
|
41
43
|
|
|
42
|
-
horizontal_offset:
|
|
44
|
+
horizontal_offset: ft.Number = 0
|
|
43
45
|
"""
|
|
44
46
|
Applies horizontal offset for showing tooltip.
|
|
45
47
|
"""
|
|
46
48
|
|
|
47
|
-
horizontal_alignment:
|
|
49
|
+
horizontal_alignment: HorizontalAlignment = HorizontalAlignment.CENTER
|
|
48
50
|
"""
|
|
49
51
|
The tooltip's horizontal alignment.
|
|
50
52
|
"""
|
|
51
53
|
|
|
52
|
-
border_side:
|
|
54
|
+
border_side: ft.BorderSide = field(default_factory=lambda: ft.BorderSide.none())
|
|
53
55
|
"""
|
|
54
56
|
The tooltip's border side.
|
|
55
57
|
"""
|
|
56
58
|
|
|
57
|
-
fit_inside_horizontally:
|
|
59
|
+
fit_inside_horizontally: bool = False
|
|
58
60
|
"""
|
|
59
61
|
Forces the tooltip to shift horizontally inside the chart, if overflow happens.
|
|
60
62
|
"""
|
|
61
63
|
|
|
62
|
-
fit_inside_vertically:
|
|
64
|
+
fit_inside_vertically: bool = False
|
|
63
65
|
"""
|
|
64
66
|
Forces the tooltip to shift vertically inside the chart, if overflow happens.
|
|
65
67
|
"""
|
|
66
68
|
|
|
69
|
+
def copy(
|
|
70
|
+
self,
|
|
71
|
+
*,
|
|
72
|
+
bgcolor: Optional[ft.ColorValue] = None,
|
|
73
|
+
border_radius: Optional[ft.BorderRadiusValue] = None,
|
|
74
|
+
padding: Optional[ft.PaddingValue] = None,
|
|
75
|
+
max_width: Optional[ft.Number] = None,
|
|
76
|
+
rotation: Optional[ft.Number] = None,
|
|
77
|
+
horizontal_offset: Optional[ft.Number] = None,
|
|
78
|
+
horizontal_alignment: Optional[HorizontalAlignment] = None,
|
|
79
|
+
border_side: Optional[ft.BorderSide] = None,
|
|
80
|
+
fit_inside_horizontally: Optional[bool] = None,
|
|
81
|
+
fit_inside_vertically: Optional[bool] = None,
|
|
82
|
+
) -> "ScatterChartTooltip":
|
|
83
|
+
"""
|
|
84
|
+
Returns a copy of this object with the specified properties overridden.
|
|
85
|
+
"""
|
|
86
|
+
return ScatterChartTooltip(
|
|
87
|
+
bgcolor=bgcolor if bgcolor is not None else self.bgcolor,
|
|
88
|
+
border_radius=border_radius
|
|
89
|
+
if border_radius is not None
|
|
90
|
+
else self.border_radius,
|
|
91
|
+
padding=padding if padding is not None else self.padding,
|
|
92
|
+
max_width=max_width if max_width is not None else self.max_width,
|
|
93
|
+
rotation=rotation if rotation is not None else self.rotation,
|
|
94
|
+
horizontal_offset=horizontal_offset
|
|
95
|
+
if horizontal_offset is not None
|
|
96
|
+
else self.horizontal_offset,
|
|
97
|
+
horizontal_alignment=horizontal_alignment
|
|
98
|
+
if horizontal_alignment is not None
|
|
99
|
+
else self.horizontal_alignment,
|
|
100
|
+
border_side=border_side if border_side is not None else self.border_side,
|
|
101
|
+
fit_inside_horizontally=fit_inside_horizontally
|
|
102
|
+
if fit_inside_horizontally is not None
|
|
103
|
+
else self.fit_inside_horizontally,
|
|
104
|
+
fit_inside_vertically=fit_inside_vertically
|
|
105
|
+
if fit_inside_vertically is not None
|
|
106
|
+
else self.fit_inside_vertically,
|
|
107
|
+
)
|
|
108
|
+
|
|
67
109
|
|
|
68
110
|
@dataclass
|
|
69
111
|
class ScatterChartEvent(ft.Event["ScatterChart"]):
|
|
70
112
|
type: ChartEventType
|
|
71
113
|
"""
|
|
72
|
-
|
|
114
|
+
The type of the event that occurred.
|
|
73
115
|
"""
|
|
74
116
|
|
|
75
117
|
spot_index: Optional[int] = None
|
|
76
118
|
"""
|
|
77
|
-
|
|
119
|
+
The index of the touched spot, if any.
|
|
78
120
|
"""
|
|
79
121
|
|
|
80
122
|
|
|
@@ -99,9 +141,6 @@ class ScatterChart(ft.ConstrainedControl):
|
|
|
99
141
|
)
|
|
100
142
|
"""
|
|
101
143
|
Controls chart implicit animation.
|
|
102
|
-
|
|
103
|
-
Value is of [`AnimationValue`](https://flet.dev/docs/reference/types/animationvalue)
|
|
104
|
-
type.
|
|
105
144
|
"""
|
|
106
145
|
|
|
107
146
|
interactive: bool = True
|
|
@@ -109,11 +148,6 @@ class ScatterChart(ft.ConstrainedControl):
|
|
|
109
148
|
Enables automatic tooltips when hovering chart bars.
|
|
110
149
|
"""
|
|
111
150
|
|
|
112
|
-
handle_built_in_touches: bool = True
|
|
113
|
-
"""
|
|
114
|
-
Whether to show a tooltip popup on top of the spots if a touch occurs.
|
|
115
|
-
"""
|
|
116
|
-
|
|
117
151
|
long_press_duration: Optional[ft.DurationValue] = None
|
|
118
152
|
"""
|
|
119
153
|
The duration of a long press on the chart.
|
|
@@ -189,14 +223,27 @@ class ScatterChart(ft.ConstrainedControl):
|
|
|
189
223
|
The maximum displayed value for Y axis.
|
|
190
224
|
"""
|
|
191
225
|
|
|
192
|
-
tooltip:
|
|
226
|
+
tooltip: ScatterChartTooltip = field(default_factory=lambda: ScatterChartTooltip())
|
|
193
227
|
"""
|
|
194
228
|
The tooltip configuration for the chart.
|
|
195
229
|
"""
|
|
196
230
|
|
|
231
|
+
show_tooltips_for_selected_spots_only: bool = False
|
|
232
|
+
"""
|
|
233
|
+
Whether to permanently and only show the tooltips of spots with their
|
|
234
|
+
[`selected`][(p).ScatterChartSpot.selected] property set to `True`.
|
|
235
|
+
"""
|
|
236
|
+
|
|
237
|
+
rotation_quarter_turns: ft.Number = 0
|
|
238
|
+
"""
|
|
239
|
+
Number of quarter turns (90-degree increments) to rotate the chart.
|
|
240
|
+
Ex: `1` rotates the chart `90` degrees clockwise,
|
|
241
|
+
`2` rotates `180` degrees and `0` for no rotation.
|
|
242
|
+
"""
|
|
243
|
+
|
|
197
244
|
on_event: Optional[ft.EventHandler[ScatterChartEvent]] = None
|
|
198
245
|
"""
|
|
199
|
-
|
|
246
|
+
Called when an event occurs on this chart.
|
|
200
247
|
"""
|
|
201
248
|
|
|
202
249
|
def __post_init__(self, ref: Optional[ft.Ref[Any]]):
|
|
@@ -3,7 +3,7 @@ from typing import Any, Optional, Union
|
|
|
3
3
|
|
|
4
4
|
import flet as ft
|
|
5
5
|
|
|
6
|
-
from .types import ChartDataPointTooltip, ChartPointShape
|
|
6
|
+
from flet_charts.types import ChartDataPointTooltip, ChartPointShape
|
|
7
7
|
|
|
8
8
|
__all__ = ["ScatterChartSpot", "ScatterChartSpotTooltip"]
|
|
9
9
|
|
|
@@ -21,6 +21,37 @@ class ScatterChartSpotTooltip(ChartDataPointTooltip):
|
|
|
21
21
|
When `None`, defaults to [`ScatterChartSpot.y`][(p).].
|
|
22
22
|
"""
|
|
23
23
|
|
|
24
|
+
bottom_margin: ft.Number = 8
|
|
25
|
+
"""
|
|
26
|
+
The bottom space from the spot.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
def copy(
|
|
30
|
+
self,
|
|
31
|
+
*,
|
|
32
|
+
text: Optional[str] = None,
|
|
33
|
+
text_style: Optional[ft.TextStyle] = None,
|
|
34
|
+
text_align: Optional[ft.TextAlign] = None,
|
|
35
|
+
text_spans: Optional[list[ft.TextSpan]] = None,
|
|
36
|
+
rtl: Optional[bool] = None,
|
|
37
|
+
bottom_margin: Optional[float] = None,
|
|
38
|
+
) -> "ScatterChartSpotTooltip":
|
|
39
|
+
"""
|
|
40
|
+
Returns a copy of this object with the specified properties overridden.
|
|
41
|
+
"""
|
|
42
|
+
return ScatterChartSpotTooltip(
|
|
43
|
+
text=text if text is not None else self.text,
|
|
44
|
+
text_style=text_style if text_style is not None else self.text_style,
|
|
45
|
+
text_align=text_align if text_align is not None else self.text_align,
|
|
46
|
+
text_spans=text_spans.copy()
|
|
47
|
+
if text_spans is not None
|
|
48
|
+
else (self.text_spans.copy() if self.text_spans is not None else None),
|
|
49
|
+
rtl=rtl if rtl is not None else self.rtl,
|
|
50
|
+
bottom_margin=bottom_margin
|
|
51
|
+
if bottom_margin is not None
|
|
52
|
+
else self.bottom_margin,
|
|
53
|
+
)
|
|
54
|
+
|
|
24
55
|
|
|
25
56
|
@ft.control("ScatterChartSpot")
|
|
26
57
|
class ScatterChartSpot(ft.BaseControl):
|
|
@@ -75,7 +106,7 @@ class ScatterChartSpot(ft.BaseControl):
|
|
|
75
106
|
TBD
|
|
76
107
|
"""
|
|
77
108
|
|
|
78
|
-
tooltip: ScatterChartSpotTooltip = field(
|
|
109
|
+
tooltip: Union[ScatterChartSpotTooltip, str] = field(
|
|
79
110
|
default_factory=lambda: ScatterChartSpotTooltip()
|
|
80
111
|
)
|
|
81
112
|
"""
|
|
@@ -87,12 +118,12 @@ class ScatterChartSpot(ft.BaseControl):
|
|
|
87
118
|
Wether to show the tooltip.
|
|
88
119
|
"""
|
|
89
120
|
|
|
90
|
-
label_text:
|
|
121
|
+
label_text: str = ""
|
|
91
122
|
"""
|
|
92
123
|
TBD
|
|
93
124
|
"""
|
|
94
125
|
|
|
95
|
-
|
|
126
|
+
label_text_style: ft.TextStyle = field(default_factory=lambda: ft.TextStyle())
|
|
96
127
|
"""
|
|
97
128
|
TBD
|
|
98
129
|
"""
|
|
@@ -101,3 +132,11 @@ class ScatterChartSpot(ft.BaseControl):
|
|
|
101
132
|
"""
|
|
102
133
|
TBD
|
|
103
134
|
"""
|
|
135
|
+
|
|
136
|
+
def before_update(self):
|
|
137
|
+
super().before_update()
|
|
138
|
+
self._internals["tooltip"] = (
|
|
139
|
+
ScatterChartSpotTooltip(text=self.tooltip)
|
|
140
|
+
if isinstance(self.tooltip, str)
|
|
141
|
+
else self.tooltip
|
|
142
|
+
)
|
flet_charts/types.py
CHANGED
|
@@ -10,10 +10,10 @@ __all__ = [
|
|
|
10
10
|
"ChartDataPointTooltip",
|
|
11
11
|
"ChartEventType",
|
|
12
12
|
"ChartGridLines",
|
|
13
|
-
"ChartHorizontalAlignment",
|
|
14
13
|
"ChartPointLine",
|
|
15
14
|
"ChartPointShape",
|
|
16
15
|
"ChartSquarePoint",
|
|
16
|
+
"HorizontalAlignment",
|
|
17
17
|
]
|
|
18
18
|
|
|
19
19
|
|
|
@@ -45,6 +45,26 @@ class ChartGridLines:
|
|
|
45
45
|
followed by blank spaces 10 pixels long. By default, a solid line is drawn.
|
|
46
46
|
"""
|
|
47
47
|
|
|
48
|
+
def copy(
|
|
49
|
+
self,
|
|
50
|
+
*,
|
|
51
|
+
interval: Optional[ft.Number] = None,
|
|
52
|
+
color: Optional[ft.ColorValue] = None,
|
|
53
|
+
width: Optional[ft.Number] = None,
|
|
54
|
+
dash_pattern: Optional[list[int]] = None,
|
|
55
|
+
) -> "ChartGridLines":
|
|
56
|
+
"""
|
|
57
|
+
Returns a copy of this object with the specified properties overridden.
|
|
58
|
+
"""
|
|
59
|
+
return ChartGridLines(
|
|
60
|
+
interval=interval if interval is not None else self.interval,
|
|
61
|
+
color=color if color is not None else self.color,
|
|
62
|
+
width=width if width is not None else self.width,
|
|
63
|
+
dash_pattern=dash_pattern.copy()
|
|
64
|
+
if dash_pattern is not None
|
|
65
|
+
else (self.dash_pattern.copy() if self.dash_pattern is not None else None),
|
|
66
|
+
)
|
|
67
|
+
|
|
48
68
|
|
|
49
69
|
@dataclass
|
|
50
70
|
class ChartPointShape:
|
|
@@ -88,6 +108,28 @@ class ChartCirclePoint(ChartPointShape):
|
|
|
88
108
|
def __post_init__(self):
|
|
89
109
|
self._type = "ChartCirclePoint"
|
|
90
110
|
|
|
111
|
+
def copy(
|
|
112
|
+
self,
|
|
113
|
+
*,
|
|
114
|
+
color: Optional[ft.ColorValue] = None,
|
|
115
|
+
radius: Optional[ft.Number] = None,
|
|
116
|
+
stroke_color: Optional[ft.ColorValue] = None,
|
|
117
|
+
stroke_width: Optional[ft.Number] = None,
|
|
118
|
+
) -> "ChartCirclePoint":
|
|
119
|
+
"""
|
|
120
|
+
Returns a copy of this object with the specified properties overridden.
|
|
121
|
+
"""
|
|
122
|
+
return ChartCirclePoint(
|
|
123
|
+
color=color if color is not None else self.color,
|
|
124
|
+
radius=radius if radius is not None else self.radius,
|
|
125
|
+
stroke_color=stroke_color
|
|
126
|
+
if stroke_color is not None
|
|
127
|
+
else self.stroke_color,
|
|
128
|
+
stroke_width=stroke_width
|
|
129
|
+
if stroke_width is not None
|
|
130
|
+
else self.stroke_width,
|
|
131
|
+
)
|
|
132
|
+
|
|
91
133
|
|
|
92
134
|
@dataclass
|
|
93
135
|
class ChartSquarePoint(ChartPointShape):
|
|
@@ -116,10 +158,32 @@ class ChartSquarePoint(ChartPointShape):
|
|
|
116
158
|
def __post_init__(self):
|
|
117
159
|
self._type = "ChartSquarePoint"
|
|
118
160
|
|
|
161
|
+
def copy(
|
|
162
|
+
self,
|
|
163
|
+
*,
|
|
164
|
+
color: Optional[ft.ColorValue] = None,
|
|
165
|
+
size: Optional[ft.Number] = None,
|
|
166
|
+
stroke_color: Optional[ft.ColorValue] = None,
|
|
167
|
+
stroke_width: Optional[ft.Number] = None,
|
|
168
|
+
) -> "ChartSquarePoint":
|
|
169
|
+
"""
|
|
170
|
+
Returns a copy of this object with the specified properties overridden.
|
|
171
|
+
"""
|
|
172
|
+
return ChartSquarePoint(
|
|
173
|
+
color=color if color is not None else self.color,
|
|
174
|
+
size=size if size is not None else self.size,
|
|
175
|
+
stroke_color=stroke_color
|
|
176
|
+
if stroke_color is not None
|
|
177
|
+
else self.stroke_color,
|
|
178
|
+
stroke_width=stroke_width
|
|
179
|
+
if stroke_width is not None
|
|
180
|
+
else self.stroke_width,
|
|
181
|
+
)
|
|
182
|
+
|
|
119
183
|
|
|
120
184
|
@dataclass
|
|
121
185
|
class ChartCrossPoint(ChartPointShape):
|
|
122
|
-
"""Draws a cross-mark(X)."""
|
|
186
|
+
"""Draws a cross-mark (X)."""
|
|
123
187
|
|
|
124
188
|
color: Optional[ft.ColorValue] = None
|
|
125
189
|
"""
|
|
@@ -140,10 +204,26 @@ class ChartCrossPoint(ChartPointShape):
|
|
|
140
204
|
def __post_init__(self):
|
|
141
205
|
self._type = "ChartCrossPoint"
|
|
142
206
|
|
|
207
|
+
def copy(
|
|
208
|
+
self,
|
|
209
|
+
*,
|
|
210
|
+
color: Optional[ft.ColorValue] = None,
|
|
211
|
+
size: Optional[ft.Number] = None,
|
|
212
|
+
width: Optional[ft.Number] = None,
|
|
213
|
+
) -> "ChartCrossPoint":
|
|
214
|
+
"""
|
|
215
|
+
Returns a copy of this object with the specified properties overridden.
|
|
216
|
+
"""
|
|
217
|
+
return ChartCrossPoint(
|
|
218
|
+
color=color if color is not None else self.color,
|
|
219
|
+
size=size if size is not None else self.size,
|
|
220
|
+
width=width if width is not None else self.width,
|
|
221
|
+
)
|
|
222
|
+
|
|
143
223
|
|
|
144
224
|
@dataclass
|
|
145
225
|
class ChartPointLine:
|
|
146
|
-
""""""
|
|
226
|
+
"""Defines style of a line."""
|
|
147
227
|
|
|
148
228
|
color: Optional[ft.ColorValue] = None
|
|
149
229
|
"""
|
|
@@ -160,6 +240,33 @@ class ChartPointLine:
|
|
|
160
240
|
The line's dash pattern.
|
|
161
241
|
"""
|
|
162
242
|
|
|
243
|
+
gradient: Optional[ft.Gradient] = None
|
|
244
|
+
"""
|
|
245
|
+
The line's gradient.
|
|
246
|
+
"""
|
|
247
|
+
|
|
248
|
+
def copy(
|
|
249
|
+
self,
|
|
250
|
+
*,
|
|
251
|
+
color: Optional[ft.ColorValue] = None,
|
|
252
|
+
width: Optional[ft.Number] = None,
|
|
253
|
+
dash_pattern: Optional[list[int]] = None,
|
|
254
|
+
gradient: Optional[ft.Gradient] = None,
|
|
255
|
+
) -> "ChartPointLine":
|
|
256
|
+
"""
|
|
257
|
+
Returns a copy of this object with the specified properties overridden.
|
|
258
|
+
"""
|
|
259
|
+
return ChartPointLine(
|
|
260
|
+
color=color if color is not None else self.color,
|
|
261
|
+
width=width if width is not None else self.width,
|
|
262
|
+
dash_pattern=dash_pattern.copy()
|
|
263
|
+
if dash_pattern is not None
|
|
264
|
+
else self.dash_pattern.copy()
|
|
265
|
+
if self.dash_pattern is not None
|
|
266
|
+
else None,
|
|
267
|
+
gradient=gradient if gradient is not None else self.gradient,
|
|
268
|
+
)
|
|
269
|
+
|
|
163
270
|
|
|
164
271
|
class ChartEventType(Enum):
|
|
165
272
|
"""The type of event that occurred on the chart."""
|
|
@@ -200,47 +307,54 @@ class ChartEventType(Enum):
|
|
|
200
307
|
|
|
201
308
|
POINTER_ENTER = "pointerEnter"
|
|
202
309
|
"""
|
|
203
|
-
|
|
310
|
+
The pointer has moved with respect to the device while the pointer is or is
|
|
311
|
+
not in contact with the device, and it has entered our chart.
|
|
204
312
|
"""
|
|
205
313
|
|
|
206
314
|
POINTER_HOVER = "pointerHover"
|
|
207
315
|
"""
|
|
208
|
-
|
|
316
|
+
The pointer has moved with respect to the device while the pointer is not
|
|
317
|
+
in contact with the device.
|
|
209
318
|
"""
|
|
210
319
|
|
|
211
320
|
PAN_DOWN = "panDown"
|
|
212
321
|
"""
|
|
213
|
-
|
|
322
|
+
When a pointer has contacted the screen and might begin to move
|
|
214
323
|
"""
|
|
215
324
|
|
|
216
325
|
PAN_START = "panStart"
|
|
217
326
|
"""
|
|
218
|
-
|
|
327
|
+
When a pointer has contacted the screen and has begun to move.
|
|
219
328
|
"""
|
|
220
329
|
|
|
221
330
|
PAN_UPDATE = "panUpdate"
|
|
222
331
|
"""
|
|
223
|
-
|
|
332
|
+
When a pointer that is in contact with the screen and moving
|
|
333
|
+
has moved again.
|
|
224
334
|
"""
|
|
225
335
|
|
|
226
336
|
LONG_PRESS_MOVE_UPDATE = "longPressMoveUpdate"
|
|
227
337
|
"""
|
|
228
|
-
|
|
338
|
+
When a pointer is moving after being held in contact at the same
|
|
339
|
+
location for a long period of time. Reports the new position and its offset
|
|
340
|
+
from the original down position.
|
|
229
341
|
"""
|
|
230
342
|
|
|
231
343
|
LONG_PRESS_START = "longPressStart"
|
|
232
344
|
"""
|
|
233
|
-
|
|
345
|
+
When a pointer has remained in contact with the screen at the
|
|
346
|
+
same location for a long period of time.
|
|
234
347
|
"""
|
|
235
348
|
|
|
236
349
|
TAP_DOWN = "tapDown"
|
|
237
350
|
"""
|
|
238
|
-
|
|
351
|
+
When a pointer that might cause a tap has contacted the
|
|
352
|
+
screen.
|
|
239
353
|
"""
|
|
240
354
|
|
|
241
355
|
UNDEFINED = "undefined"
|
|
242
356
|
"""
|
|
243
|
-
|
|
357
|
+
An undefined event.
|
|
244
358
|
"""
|
|
245
359
|
|
|
246
360
|
|
|
@@ -252,7 +366,7 @@ class ChartDataPointTooltip:
|
|
|
252
366
|
|
|
253
367
|
text: Optional[str] = None
|
|
254
368
|
"""
|
|
255
|
-
The text to display in
|
|
369
|
+
The text to display in this tooltip.
|
|
256
370
|
"""
|
|
257
371
|
|
|
258
372
|
text_style: ft.TextStyle = field(default_factory=lambda: ft.TextStyle())
|
|
@@ -262,16 +376,45 @@ class ChartDataPointTooltip:
|
|
|
262
376
|
|
|
263
377
|
text_align: ft.TextAlign = ft.TextAlign.CENTER
|
|
264
378
|
"""
|
|
265
|
-
|
|
379
|
+
The text alignment of the tooltip.
|
|
266
380
|
"""
|
|
267
381
|
|
|
268
382
|
text_spans: Optional[list[ft.TextSpan]] = None
|
|
269
383
|
"""
|
|
270
|
-
Additional text spans to show on
|
|
384
|
+
Additional text spans to show on this tooltip.
|
|
385
|
+
"""
|
|
386
|
+
|
|
387
|
+
rtl: bool = False
|
|
271
388
|
"""
|
|
389
|
+
Whether the text is right-to-left.
|
|
390
|
+
"""
|
|
391
|
+
|
|
392
|
+
def copy(
|
|
393
|
+
self,
|
|
394
|
+
*,
|
|
395
|
+
text: Optional[str] = None,
|
|
396
|
+
text_style: Optional[ft.TextStyle] = None,
|
|
397
|
+
text_align: Optional[ft.TextAlign] = None,
|
|
398
|
+
text_spans: Optional[list[ft.TextSpan]] = None,
|
|
399
|
+
rtl: Optional[bool] = None,
|
|
400
|
+
) -> "ChartDataPointTooltip":
|
|
401
|
+
"""
|
|
402
|
+
Returns a copy of this object with the specified properties overridden.
|
|
403
|
+
"""
|
|
404
|
+
return ChartDataPointTooltip(
|
|
405
|
+
text=text if text is not None else self.text,
|
|
406
|
+
text_style=text_style if text_style is not None else self.text_style,
|
|
407
|
+
text_align=text_align if text_align is not None else self.text_align,
|
|
408
|
+
text_spans=text_spans.copy()
|
|
409
|
+
if text_spans is not None
|
|
410
|
+
else self.text_spans.copy()
|
|
411
|
+
if self.text_spans is not None
|
|
412
|
+
else None,
|
|
413
|
+
rtl=rtl if rtl is not None else self.rtl,
|
|
414
|
+
)
|
|
272
415
|
|
|
273
416
|
|
|
274
|
-
class
|
|
417
|
+
class HorizontalAlignment(Enum):
|
|
275
418
|
"""Defines an element's horizontal alignment to given point."""
|
|
276
419
|
|
|
277
420
|
LEFT = "left"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flet-charts
|
|
3
|
-
Version: 0.2.0.
|
|
3
|
+
Version: 0.2.0.dev84
|
|
4
4
|
Summary: A Flet extension for creating interactive charts and graphs.
|
|
5
5
|
Author-email: Flet contributors <hello@flet.dev>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -12,13 +12,6 @@ Requires-Python: >=3.10
|
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
14
|
Requires-Dist: flet>=0.70.0.dev0
|
|
15
|
-
Provides-Extra: all
|
|
16
|
-
Requires-Dist: plotly>=6.0.1; extra == "all"
|
|
17
|
-
Requires-Dist: matplotlib>=3.10.1; extra == "all"
|
|
18
|
-
Provides-Extra: plotly
|
|
19
|
-
Requires-Dist: plotly>=6.0.1; extra == "plotly"
|
|
20
|
-
Provides-Extra: matplotlib
|
|
21
|
-
Requires-Dist: matplotlib>=3.10.1; extra == "matplotlib"
|
|
22
15
|
Dynamic: license-file
|
|
23
16
|
|
|
24
17
|
# flet-charts
|
|
@@ -48,7 +41,9 @@ This package supports the following platforms:
|
|
|
48
41
|
| Android | ✅ |
|
|
49
42
|
| Web | ✅ |
|
|
50
43
|
|
|
51
|
-
##
|
|
44
|
+
## Usage
|
|
45
|
+
|
|
46
|
+
### Installation
|
|
52
47
|
|
|
53
48
|
To install the `flet-charts` package and add it to your project dependencies:
|
|
54
49
|
|
|
@@ -67,3 +62,7 @@ To install the `flet-charts` package and add it to your project dependencies:
|
|
|
67
62
|
```bash
|
|
68
63
|
poetry add flet-charts
|
|
69
64
|
```
|
|
65
|
+
|
|
66
|
+
### Examples
|
|
67
|
+
|
|
68
|
+
For examples, see [these](./examples).
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
flet_charts/__init__.py,sha256=nDRlnDCu1302gO75mgX2dEiKXMeL_okH8GShCFfZYkg,2157
|
|
2
|
+
flet_charts/bar_chart.py,sha256=SB4QDcHautFPvQoz-8QQjlQGVRcbA215m-eYbZb46go,7858
|
|
3
|
+
flet_charts/bar_chart_group.py,sha256=O9-jSiCgO28mq0-DDUJznfcGLJbWvLmnGrzf9BLjH1I,702
|
|
4
|
+
flet_charts/bar_chart_rod.py,sha256=66BdckFGr-YUNXNIQb4NzvGGy8HIXGCzTOfHFOZhRi8,3575
|
|
5
|
+
flet_charts/bar_chart_rod_stack_item.py,sha256=XPLRpHdScmdde2UAau47OLSSL-AuQUbLpT1g7pNS9kI,623
|
|
6
|
+
flet_charts/chart_axis.py,sha256=jKX1bxQqxW3piNmyJUQShGATwnI1sKjXtKP425iDRhg,1869
|
|
7
|
+
flet_charts/line_chart.py,sha256=v7bcCFwYKIGwRCopQG4piWLY5mXn1Qu0Y-ozcbACL-g,8197
|
|
8
|
+
flet_charts/line_chart_data.py,sha256=Q9A3UlZ8zp8wpcTdqjgh0mAfO9GhlUpeWXljGY3bFrk,4162
|
|
9
|
+
flet_charts/line_chart_data_point.py,sha256=3OrM19H3hDJppiGmE2CTm_K3dWf83Rr-wELPC3Ak_OA,3253
|
|
10
|
+
flet_charts/matplotlib_chart.py,sha256=cWDqMSuUxfXYb-DjU6sp7fcHWh1DV2Ig7w62aYS6Fag,1878
|
|
11
|
+
flet_charts/pie_chart.py,sha256=z7S3jzlndxMzJtevVMohakPAV8CvNt_wKg_Z9d8w3ac,2016
|
|
12
|
+
flet_charts/pie_chart_section.py,sha256=KdUF91BYAhY63U3NxMuY9Go56Ss0w-dmT8hLdxgP-tQ,2482
|
|
13
|
+
flet_charts/plotly_chart.py,sha256=UUR4lYhae_TeTH4juEei6QvRcdJ5dA4Xvhahpl7sOBo,1662
|
|
14
|
+
flet_charts/scatter_chart.py,sha256=JhrC9rm2ni7Y1twLahvEVtzGHFsBPL6KyQwCPCNTZfk,7158
|
|
15
|
+
flet_charts/scatter_chart_spot.py,sha256=VcEta4HYkU_EmwbRNifQXao4o6wNNNZ81YdKRcrxN28,3663
|
|
16
|
+
flet_charts/types.py,sha256=0VNeobnKFjM5F164yqH81qGJVbtewhJEGAygMWy7SCs,11121
|
|
17
|
+
flet_charts-0.2.0.dev84.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
18
|
+
flutter/flet_charts/CHANGELOG.md,sha256=JbP72D9_B4ipiQh7Ezg1O6gSCUi9GA8CseA31Wg2oWw,40
|
|
19
|
+
flutter/flet_charts/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
|
20
|
+
flutter/flet_charts/README.md,sha256=rIiq6cSepxf6Rhq2bZGK0PcMAlkz8iTfruGf2hbKFHQ,75
|
|
21
|
+
flutter/flet_charts/analysis_options.yaml,sha256=tNXU6s4EJ4KmXROObwPetH5vkzRTVG4AH4gpMw85_EY,154
|
|
22
|
+
flutter/flet_charts/pubspec.lock,sha256=F9gVrJdeBsiBjj63Ui3mHjazGfx_ZBqLvIWgpBwoO8o,23511
|
|
23
|
+
flutter/flet_charts/pubspec.yaml,sha256=RB9sfjlNztvDASX0kAJGmXIaV_NamD7U_dVEhS5FMJ8,570
|
|
24
|
+
flutter/flet_charts/lib/flet_charts.dart,sha256=66hr4Shizat1MIyu957NiJI_xXYOSeOJbFI489qw7ok,70
|
|
25
|
+
flutter/flet_charts/lib/src/bar_chart.dart,sha256=6K_WPR4NzI_C9dor0eblESZi5hdf6PpKGD6xTml9KDI,3683
|
|
26
|
+
flutter/flet_charts/lib/src/extension.dart,sha256=ag-uvBKJQ1t38ySvkyFYheRFL7YITk7Pj0Eahf788pE,702
|
|
27
|
+
flutter/flet_charts/lib/src/line_chart.dart,sha256=iij6QsZG0PgSCnZoK9YHQTwH7nJnM1_pNrb2zt-Mtk8,8733
|
|
28
|
+
flutter/flet_charts/lib/src/pie_chart.dart,sha256=WQWrUcPjTj2ywUtA2ZwAwRmzv1mouS17Hj-uSOJtD-c,2384
|
|
29
|
+
flutter/flet_charts/lib/src/scatter_chart.dart,sha256=CVdnTNlXmQZxonjs2e0jXAGGMs1LT1e4iujTEkopTII,5541
|
|
30
|
+
flutter/flet_charts/lib/src/utils/bar_chart.dart,sha256=UoN91zac8aoeHrNE7OwMKCAZq_wP17GYu4lSNYDDtFo,7013
|
|
31
|
+
flutter/flet_charts/lib/src/utils/charts.dart,sha256=5Umt7NIzHp9UBDdIQ_8YQCxn8vQs8nC1NtpKzJ7aC64,6479
|
|
32
|
+
flutter/flet_charts/lib/src/utils/line_chart.dart,sha256=s_9iokaUFHNipu_YVw6OSJcmD8JctWCoImrIyuxB688,8633
|
|
33
|
+
flutter/flet_charts/lib/src/utils/pie_chart.dart,sha256=GbxCrhx_SXtJFH_94raOd_m_u7r37NRc6IExi-Qcumw,1850
|
|
34
|
+
flutter/flet_charts/lib/src/utils/scatter_chart.dart,sha256=KqJxvpl8jIZkQw132Ab4x4nhHTyiUw8M2NExgRCXf1k,3323
|
|
35
|
+
flet_charts-0.2.0.dev84.dist-info/METADATA,sha256=pRo0qHRVmRos0RBUcxPP887DCilH-AnQz86PSQumGXw,1970
|
|
36
|
+
flet_charts-0.2.0.dev84.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
37
|
+
flet_charts-0.2.0.dev84.dist-info/top_level.txt,sha256=CVHmtljbPFTyfCiru5bxX1vvWL8L6rtUbV9bqqkSxFE,20
|
|
38
|
+
flet_charts-0.2.0.dev84.dist-info/RECORD,,
|
|
@@ -57,6 +57,8 @@ class _BarChartControlState extends State<BarChartControl> {
|
|
|
57
57
|
bottomTitles: bottomTitles,
|
|
58
58
|
),
|
|
59
59
|
borderData: FlBorderData(show: border != null, border: border),
|
|
60
|
+
alignment: parseBarChartAlignment(
|
|
61
|
+
widget.control.getMainAxisAlignment("group_alignment")?.name),
|
|
60
62
|
gridData: parseChartGridData(
|
|
61
63
|
widget.control.get("horizontal_grid_lines"),
|
|
62
64
|
widget.control.get("vertical_grid_lines"),
|