flet-charts 0.2.0.dev18__py3-none-any.whl → 0.2.0.dev40__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/pie_chart.py CHANGED
@@ -10,12 +10,10 @@ __all__ = ["PieChart", "PieChartEvent"]
10
10
 
11
11
 
12
12
  @dataclass
13
- class PieChartEvent(ft.Event[ft.EventControlType]):
13
+ class PieChartEvent(ft.Event["PieChart"]):
14
14
  type: ChartEventType
15
15
  """
16
16
  Type of the event.
17
-
18
- Value is of type [`ChartEventType`][(p).].
19
17
  """
20
18
 
21
19
  section_index: Optional[int] = None
@@ -50,7 +48,7 @@ class PieChart(ft.ConstrainedControl):
50
48
 
51
49
  center_space_color: Optional[ft.ColorValue] = None
52
50
  """
53
- Free space [color](https://flet.dev/docs/reference/colors) in the middle of a chart.
51
+ Free space color in the middle of a chart.
54
52
  """
55
53
 
56
54
  center_space_radius: Optional[ft.Number] = None
@@ -77,13 +75,9 @@ class PieChart(ft.ConstrainedControl):
77
75
  )
78
76
  """
79
77
  Controls chart implicit animation.
80
-
81
- Value is of type [`AnimationValue`](https://flet.dev/docs/reference/types/animationvalue).
82
78
  """
83
79
 
84
- on_event: ft.OptionalEventHandler[PieChartEvent["PieChart"]] = None
80
+ on_event: Optional[ft.EventHandler[PieChartEvent]] = None
85
81
  """
86
82
  Fires when a chart section is hovered or clicked.
87
-
88
- Event data is an instance [`PieChartEvent`][(p).].
89
83
  """
@@ -29,14 +29,12 @@ class PieChartSection(ft.BaseControl):
29
29
 
30
30
  color: Optional[ft.ColorValue] = None
31
31
  """
32
- Background [color](https://flet.dev/docs/reference/colors) of the section.
32
+ Background color of the section.
33
33
  """
34
34
 
35
35
  border_side: ft.BorderSide = field(default_factory=lambda: ft.BorderSide.none())
36
36
  """
37
37
  The border around section shape.
38
-
39
- Value is of type [`BorderSide`](https://flet.dev/docs/reference/types/borderside).
40
38
  """
41
39
 
42
40
  title: Optional[str] = None
@@ -47,19 +45,16 @@ class PieChartSection(ft.BaseControl):
47
45
  title_style: Optional[ft.TextStyle] = None
48
46
  """
49
47
  The style to draw `title` with.
50
-
51
- The value is an instance of [`TextStyle`](https://flet.dev/docs/reference/types/textstyle)
52
- class.
53
48
  """
54
49
 
55
50
  title_position: Optional[ft.Number] = None
56
51
  """
57
52
  The position/offset of the title relative to the section's center.
58
-
53
+
59
54
  By default the title is drawn in the middle of the section.
60
-
55
+
61
56
  Note:
62
- Must be between `0.0` (near the center)
57
+ Must be between `0.0` (near the center)
63
58
  and `1.0`(near the outside of the chart) inclusive.
64
59
  """
65
60
 
@@ -71,19 +66,21 @@ class PieChartSection(ft.BaseControl):
71
66
  badge_position: Optional[ft.Number] = None
72
67
  """
73
68
  The position/offset of the badge relative to the section's center.
74
-
69
+
75
70
  By default the badge is drawn in the middle of the section.
76
-
71
+
77
72
  Note:
78
- Must be between `0.0` (near the center)
73
+ Must be between `0.0` (near the center)
79
74
  and `1.0`(near the outside of the chart) inclusive.
80
75
  """
81
76
 
82
77
  def before_update(self):
83
78
  super().before_update()
84
79
  assert self.title_position is None or (0.0 <= self.title_position <= 1.0), (
85
- f"title_position ({self.title_position}) must be between 0.0 and 1.0 inclusive"
80
+ f"title_position must be between 0.0 and 1.0 inclusive, "
81
+ f"got {self.title_position}"
86
82
  )
87
83
  assert self.badge_position is None or (0.0 <= self.badge_position <= 1.0), (
88
- f"badge_position ({self.badge_position}) must be between 0.0 and 1.0 inclusive"
84
+ f"badge_position must be between 0.0 and 1.0 inclusive, "
85
+ f"got {self.badge_position}"
89
86
  )
@@ -20,14 +20,15 @@ class PlotlyChart(ft.Container):
20
20
  Displays a [Plotly](https://plotly.com/python/) chart.
21
21
 
22
22
  Warning:
23
- This control requires the [`plotly`](https://plotly.com/python/) Python package to be installed.
23
+ This control requires the [`plotly`](https://plotly.com/python/) Python
24
+ package to be installed.
24
25
 
25
26
  See this [installation guide](index.md#installation) for more information.
26
27
  """
27
28
 
28
29
  figure: Figure = field(metadata={"skip": True})
29
30
  """
30
- Plotly figure to draw -
31
+ Plotly figure to draw -
31
32
  an instance of [`plotly.graph_objects.Figure`](https://plotly.com/python-api-reference/generated/plotly.graph_objects.Figure.html).
32
33
  """
33
34
 
@@ -39,7 +40,7 @@ class PlotlyChart(ft.Container):
39
40
  """
40
41
 
41
42
  def init(self):
42
- self.alignment = ft.Alignment.center()
43
+ self.alignment = ft.Alignment.CENTER
43
44
  self.__img = ft.Image(fit=ft.BoxFit.FILL)
44
45
  self.content = self.__img
45
46
 
@@ -16,7 +16,7 @@ class ScatterChartTooltip:
16
16
 
17
17
  bgcolor: ft.ColorValue = "#FF607D8B"
18
18
  """
19
- The tooltip's background [color](https://flet.dev/docs/reference/colors).
19
+ The tooltip's background color.
20
20
  """
21
21
 
22
22
  border_radius: Optional[ft.BorderRadiusValue] = None
@@ -64,9 +64,51 @@ class ScatterChartTooltip:
64
64
  Forces the tooltip to shift vertically inside the chart, if overflow happens.
65
65
  """
66
66
 
67
+ def copy_with(
68
+ self,
69
+ *,
70
+ bgcolor: Optional[ft.ColorValue] = None,
71
+ border_radius: Optional[ft.BorderRadiusValue] = None,
72
+ padding: Optional[ft.PaddingValue] = None,
73
+ max_width: Optional[ft.Number] = None,
74
+ rotate_angle: Optional[ft.Number] = None,
75
+ horizontal_offset: Optional[ft.Number] = None,
76
+ horizontal_alignment: Optional[ChartHorizontalAlignment] = None,
77
+ border_side: Optional[ft.BorderSide] = None,
78
+ fit_inside_horizontally: Optional[bool] = None,
79
+ fit_inside_vertically: Optional[bool] = None,
80
+ ) -> "ScatterChartTooltip":
81
+ """
82
+ Returns a copy of this object with the specified properties overridden.
83
+ """
84
+ return ScatterChartTooltip(
85
+ bgcolor=bgcolor if bgcolor is not None else self.bgcolor,
86
+ border_radius=border_radius
87
+ if border_radius is not None
88
+ else self.border_radius,
89
+ padding=padding if padding is not None else self.padding,
90
+ max_width=max_width if max_width is not None else self.max_width,
91
+ rotate_angle=rotate_angle
92
+ if rotate_angle is not None
93
+ else self.rotate_angle,
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
- class ScatterChartEvent(ft.Event[ft.EventControlType]):
111
+ class ScatterChartEvent(ft.Event["ScatterChart"]):
70
112
  type: ChartEventType
71
113
  """
72
114
  Type of the event (e.g. tapDown, panUpdate)
@@ -132,43 +174,31 @@ class ScatterChart(ft.ConstrainedControl):
132
174
  horizontal_grid_lines: Optional[ChartGridLines] = None
133
175
  """
134
176
  Controls drawing of chart's horizontal lines.
135
-
136
- Value is of type [`ChartGridLines`][(p).].
137
177
  """
138
178
 
139
179
  vertical_grid_lines: Optional[ChartGridLines] = None
140
180
  """
141
181
  Controls drawing of chart's vertical lines.
142
-
143
- Value is of type [`ChartGridLines`][(p).].
144
182
  """
145
183
 
146
184
  left_axis: ChartAxis = field(default_factory=lambda: ChartAxis())
147
185
  """
148
186
  Configures the appearance of the left axis, its title and labels.
149
-
150
- Value is of type [`ChartAxis`][(p).].
151
187
  """
152
188
 
153
189
  top_axis: ChartAxis = field(default_factory=lambda: ChartAxis())
154
190
  """
155
191
  Configures the appearance of the top axis, its title and labels.
156
-
157
- Value is of type [`ChartAxis`][(p).].
158
192
  """
159
193
 
160
194
  right_axis: ChartAxis = field(default_factory=lambda: ChartAxis())
161
195
  """
162
196
  Configures the appearance of the right axis, its title and labels.
163
-
164
- Value is of type [`ChartAxis`][(p).].
165
197
  """
166
198
 
167
199
  bottom_axis: ChartAxis = field(default_factory=lambda: ChartAxis())
168
200
  """
169
201
  Configures the appearance of the bottom axis, its title and labels.
170
-
171
- Value is of type [`ChartAxis`][(p).].
172
202
  """
173
203
 
174
204
  baseline_x: Optional[ft.Number] = None
@@ -206,11 +236,9 @@ class ScatterChart(ft.ConstrainedControl):
206
236
  The tooltip configuration for the chart.
207
237
  """
208
238
 
209
- on_event: ft.OptionalEventHandler[ScatterChartEvent["ScatterChart"]] = None
239
+ on_event: Optional[ft.EventHandler[ScatterChartEvent]] = None
210
240
  """
211
241
  Fires when an event occurs on the chart.
212
-
213
- Event handler receives an instance of [`ScatterChartEvent`][(p).].
214
242
  """
215
243
 
216
244
  def __post_init__(self, ref: Optional[ft.Ref[Any]]):
@@ -21,6 +21,26 @@ class ScatterChartSpotTooltip(ChartDataPointTooltip):
21
21
  When `None`, defaults to [`ScatterChartSpot.y`][(p).].
22
22
  """
23
23
 
24
+ def copy_with(
25
+ self,
26
+ *,
27
+ text: Optional[str] = None,
28
+ text_style: Optional[ft.TextStyle] = None,
29
+ text_align: Optional[ft.TextAlign] = None,
30
+ text_spans: Optional[list[ft.TextSpan]] = None,
31
+ ) -> "ScatterChartSpotTooltip":
32
+ """
33
+ Returns a copy of this object with the specified properties overridden.
34
+ """
35
+ return ScatterChartSpotTooltip(
36
+ text=text if text is not None else self.text,
37
+ text_style=text_style if text_style is not None else self.text_style,
38
+ text_align=text_align if text_align is not None else self.text_align,
39
+ text_spans=text_spans.copy()
40
+ if text_spans is not None
41
+ else (self.text_spans.copy() if self.text_spans is not None else None),
42
+ )
43
+
24
44
 
25
45
  @ft.control("ScatterChartSpot")
26
46
  class ScatterChartSpot(ft.BaseControl):
@@ -58,16 +78,16 @@ class ScatterChartSpot(ft.BaseControl):
58
78
 
59
79
  x_error: Optional[Any] = None
60
80
  """
61
- Determines the error range of the data point using
62
- (FlErrorRange)[https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/base_chart.md#flerrorrange]
63
- (which ontains lowerBy and upperValue) for the `X` axis.
81
+ Determines the error range of the data point using
82
+ [FlErrorRange](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/base_chart.md#flerrorrange)
83
+ (which contains lowerBy and upperValue) for the `X` axis.
64
84
  """
65
85
 
66
86
  y_error: Optional[Any] = None
67
87
  """
68
- Determines the error range of the data point using
69
- (FlErrorRange)[https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/base_chart.md#flerrorrange]
70
- (which ontains lowerBy and upperValue) for the `Y` axis.
88
+ Determines the error range of the data point using
89
+ [FlErrorRange](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/base_chart.md#flerrorrange)
90
+ (which contains lowerBy and upperValue) for the `Y` axis.
71
91
  """
72
92
 
73
93
  selected: bool = False
@@ -75,7 +95,9 @@ class ScatterChartSpot(ft.BaseControl):
75
95
  TBD
76
96
  """
77
97
 
78
- tooltip: ScatterChartSpotTooltip = field(default_factory=lambda: ScatterChartSpotTooltip())
98
+ tooltip: Union[ScatterChartSpotTooltip, str] = field(
99
+ default_factory=lambda: ScatterChartSpotTooltip()
100
+ )
79
101
  """
80
102
  Tooltip configuration for this spot.
81
103
  """
@@ -100,3 +122,10 @@ class ScatterChartSpot(ft.BaseControl):
100
122
  TBD
101
123
  """
102
124
 
125
+ def before_update(self):
126
+ super().before_update()
127
+ self._internals["tooltip"] = (
128
+ ScatterChartSpotTooltip(text=self.tooltip)
129
+ if isinstance(self.tooltip, str)
130
+ else self.tooltip
131
+ )
flet_charts/types.py CHANGED
@@ -5,15 +5,15 @@ from typing import Optional
5
5
  import flet as ft
6
6
 
7
7
  __all__ = [
8
- "ChartPointShape",
9
8
  "ChartCirclePoint",
10
- "ChartSquarePoint",
11
9
  "ChartCrossPoint",
12
- "ChartPointLine",
10
+ "ChartDataPointTooltip",
13
11
  "ChartEventType",
14
12
  "ChartGridLines",
15
- "ChartDataPointTooltip",
16
13
  "ChartHorizontalAlignment",
14
+ "ChartPointLine",
15
+ "ChartPointShape",
16
+ "ChartSquarePoint",
17
17
  ]
18
18
 
19
19
 
@@ -30,7 +30,7 @@ class ChartGridLines:
30
30
 
31
31
  color: Optional[ft.ColorValue] = None
32
32
  """
33
- The [color](https://flet.dev/docs/reference/colors) of a grid line.
33
+ The color of a grid line.
34
34
  """
35
35
 
36
36
  width: ft.Number = 2.0
@@ -45,8 +45,28 @@ 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_with(
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
- @dataclass(kw_only=True) # todo
69
+ @dataclass
50
70
  class ChartPointShape:
51
71
  """
52
72
  Base class for chart point shapes.
@@ -67,7 +87,7 @@ class ChartCirclePoint(ChartPointShape):
67
87
 
68
88
  color: Optional[ft.ColorValue] = None
69
89
  """
70
- The fill [color](https://flet.dev/docs/reference/colors) to use for the circle.
90
+ The fill color to use for the circle.
71
91
  """
72
92
 
73
93
  radius: Optional[ft.Number] = None
@@ -77,7 +97,7 @@ class ChartCirclePoint(ChartPointShape):
77
97
 
78
98
  stroke_color: Optional[ft.ColorValue] = None
79
99
  """
80
- The stroke [color](https://flet.dev/docs/reference/colors) to use for the circle
100
+ The stroke color to use for the circle
81
101
  """
82
102
 
83
103
  stroke_width: ft.Number = 0
@@ -88,6 +108,28 @@ class ChartCirclePoint(ChartPointShape):
88
108
  def __post_init__(self):
89
109
  self._type = "ChartCirclePoint"
90
110
 
111
+ def copy_with(
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):
@@ -95,7 +137,7 @@ class ChartSquarePoint(ChartPointShape):
95
137
 
96
138
  color: Optional[ft.ColorValue] = None
97
139
  """
98
- The fill [color](https://flet.dev/docs/reference/colors) to use for the square.
140
+ The fill color to use for the square.
99
141
  """
100
142
 
101
143
  size: ft.Number = 4.0
@@ -105,7 +147,7 @@ class ChartSquarePoint(ChartPointShape):
105
147
 
106
148
  stroke_color: Optional[ft.ColorValue] = None
107
149
  """
108
- The stroke [color](https://flet.dev/docs/reference/colors) to use for the square.
150
+ The stroke color to use for the square.
109
151
  """
110
152
 
111
153
  stroke_width: ft.Number = 1.0
@@ -116,6 +158,28 @@ class ChartSquarePoint(ChartPointShape):
116
158
  def __post_init__(self):
117
159
  self._type = "ChartSquarePoint"
118
160
 
161
+ def copy_with(
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):
@@ -123,7 +187,7 @@ class ChartCrossPoint(ChartPointShape):
123
187
 
124
188
  color: Optional[ft.ColorValue] = None
125
189
  """
126
- The fill [color](https://flet.dev/docs/reference/colors) to use for the
190
+ The fill color to use for the
127
191
  cross-mark(X).
128
192
  """
129
193
 
@@ -140,6 +204,22 @@ class ChartCrossPoint(ChartPointShape):
140
204
  def __post_init__(self):
141
205
  self._type = "ChartCrossPoint"
142
206
 
207
+ def copy_with(
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:
@@ -147,7 +227,7 @@ class ChartPointLine:
147
227
 
148
228
  color: Optional[ft.ColorValue] = None
149
229
  """
150
- The line's [color](https://flet.dev/docs/reference/colors).
230
+ The line's color.
151
231
  """
152
232
 
153
233
  width: ft.Number = 2
@@ -160,13 +240,33 @@ class ChartPointLine:
160
240
  The line's dash pattern.
161
241
  """
162
242
 
243
+ def copy_with(
244
+ self,
245
+ *,
246
+ color: Optional[ft.ColorValue] = None,
247
+ width: Optional[ft.Number] = None,
248
+ dash_pattern: Optional[list[int]] = None,
249
+ ) -> "ChartPointLine":
250
+ """
251
+ Returns a copy of this object with the specified properties overridden.
252
+ """
253
+ return ChartPointLine(
254
+ color=color if color is not None else self.color,
255
+ width=width if width is not None else self.width,
256
+ dash_pattern=dash_pattern.copy()
257
+ if dash_pattern is not None
258
+ else self.dash_pattern.copy()
259
+ if self.dash_pattern is not None
260
+ else None,
261
+ )
262
+
163
263
 
164
264
  class ChartEventType(Enum):
165
265
  """The type of event that occurred on the chart."""
166
266
 
167
267
  PAN_END = "panEnd"
168
268
  """
169
- When a pointer that was previously in contact with
269
+ When a pointer that was previously in contact with
170
270
  the screen and moving is no longer in contact with the screen.
171
271
  """
172
272
 
@@ -177,14 +277,14 @@ class ChartEventType(Enum):
177
277
 
178
278
  POINTER_EXIT = "pointerExit"
179
279
  """
180
- The pointer has moved with respect to the device while the
280
+ The pointer has moved with respect to the device while the
181
281
  pointer is or is not in contact with the device, and exited our chart.
182
282
  """
183
283
 
184
284
  LONG_PRESS_END = "longPressEnd"
185
285
  """
186
- When a pointer stops contacting the screen after a long press
187
- gesture was detected. Also reports the position where the
286
+ When a pointer stops contacting the screen after a long press
287
+ gesture was detected. Also reports the position where the
188
288
  pointer stopped contacting the screen.
189
289
  """
190
290
 
@@ -200,7 +300,7 @@ class ChartEventType(Enum):
200
300
 
201
301
  POINTER_ENTER = "pointerEnter"
202
302
  """
203
-
303
+
204
304
  """
205
305
 
206
306
  POINTER_HOVER = "pointerHover"
@@ -258,15 +358,11 @@ class ChartDataPointTooltip:
258
358
  text_style: ft.TextStyle = field(default_factory=lambda: ft.TextStyle())
259
359
  """
260
360
  A text style to display tooltip with.
261
-
262
- Value is of type [`TextStyle`](https://flet.dev/docs/reference/types/textstyle).
263
361
  """
264
362
 
265
363
  text_align: ft.TextAlign = ft.TextAlign.CENTER
266
364
  """
267
365
  An align for the tooltip.
268
-
269
- Value is of type [`TextAlign`](https://flet.dev/docs/reference/types/textalign).
270
366
  """
271
367
 
272
368
  text_spans: Optional[list[ft.TextSpan]] = None
@@ -274,6 +370,28 @@ class ChartDataPointTooltip:
274
370
  Additional text spans to show on a tooltip.
275
371
  """
276
372
 
373
+ def copy_with(
374
+ self,
375
+ *,
376
+ text: Optional[str] = None,
377
+ text_style: Optional[ft.TextStyle] = None,
378
+ text_align: Optional[ft.TextAlign] = None,
379
+ text_spans: Optional[list[ft.TextSpan]] = None,
380
+ ) -> "ChartDataPointTooltip":
381
+ """
382
+ Returns a copy of this object with the specified properties overridden.
383
+ """
384
+ return ChartDataPointTooltip(
385
+ text=text if text is not None else self.text,
386
+ text_style=text_style if text_style is not None else self.text_style,
387
+ text_align=text_align if text_align is not None else self.text_align,
388
+ text_spans=text_spans.copy()
389
+ if text_spans is not None
390
+ else self.text_spans.copy()
391
+ if self.text_spans is not None
392
+ else None,
393
+ )
394
+
277
395
 
278
396
  class ChartHorizontalAlignment(Enum):
279
397
  """Defines an element's horizontal alignment to given point."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flet-charts
3
- Version: 0.2.0.dev18
3
+ Version: 0.2.0.dev40
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
@@ -0,0 +1,38 @@
1
+ flet_charts/__init__.py,sha256=9WKqCmIz157g3fIFXteMg2RNl1FG2jMF77Dzc80lAD0,1972
2
+ flet_charts/bar_chart.py,sha256=A02qcwTJwWeLTUO4eAf3knsCmj2xeEzuffxA4o28-34,7010
3
+ flet_charts/bar_chart_group.py,sha256=eHbrtFqAn99VG2cqWf-yGgbpgcEOZFStpZqqnMP_z3w,691
4
+ flet_charts/bar_chart_rod.py,sha256=yv5yFMBcUKBp3aq62z6vuuGA0W18NvE7s3EXwMmMKKM,3468
5
+ flet_charts/bar_chart_rod_stack_item.py,sha256=XPLRpHdScmdde2UAau47OLSSL-AuQUbLpT1g7pNS9kI,623
6
+ flet_charts/chart_axis.py,sha256=BJW1ufpet2OueaDgbV82lJteT1G1wtzWtgB3vqeCb38,1330
7
+ flet_charts/line_chart.py,sha256=ZHUye216GR0BOqEggStC3FmsuDFJ3LSEdLByoAMS5QQ,7957
8
+ flet_charts/line_chart_data.py,sha256=LX1a_TL-i1fLtLVI23mxD4UaEs4CvubfXdjZK5ppPJ0,3369
9
+ flet_charts/line_chart_data_point.py,sha256=Dan7SYjIsb34m65rPxJuf9NfDg0wlZeU56gFuB7sT6k,3157
10
+ flet_charts/matplotlib_chart.py,sha256=cWDqMSuUxfXYb-DjU6sp7fcHWh1DV2Ig7w62aYS6Fag,1878
11
+ flet_charts/pie_chart.py,sha256=MCqx6zL4_hGJpLFFerE3dG3Fq0gEjvXemxDnl5yx6kg,1994
12
+ flet_charts/pie_chart_section.py,sha256=0A90iyBQi5rA3g8MfgxyLLGFR9p9X7zfzQEnFIEc6rM,2342
13
+ flet_charts/plotly_chart.py,sha256=UUR4lYhae_TeTH4juEei6QvRcdJ5dA4Xvhahpl7sOBo,1662
14
+ flet_charts/scatter_chart.py,sha256=JgfGarGEtOQs1olqRrzldJKfOZewnFpO5_0ndV1Q52s,6855
15
+ flet_charts/scatter_chart_spot.py,sha256=qYKUFmuXJl-BvejWjoTuQPl9Ule1E8TeinT_iclXV68,3292
16
+ flet_charts/types.py,sha256=_SjfcHyOTrCepvBnjhgrCUhdelqCTOKNiy7LY9j-oZI,9887
17
+ flet_charts-0.2.0.dev40.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=vfjfvpcRMdxujDnWDYbiM9ynlAETgNcoSICsNnCqDg8,23058
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=W-W8jdPk8zD2WqiPVoeNjCZ5hZG51ad2Ohr6rNv1Jfk,3565
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=GDvMhFfNzNlsrMD0vTwB39k4QNLGQSIN-ciDW9tR-yw,5521
30
+ flutter/flet_charts/lib/src/utils/bar_chart.dart,sha256=Xftm3hjy-qdkK2fa65o-gBTTvviZGS9Fx37akdjTwBU,6351
31
+ flutter/flet_charts/lib/src/utils/charts.dart,sha256=1r4YfLGtOIssLyCBxQmCggSv2Zmy9QEdME4KMDkjwoU,5973
32
+ flutter/flet_charts/lib/src/utils/line_chart.dart,sha256=P9ZQQbsfCAElrAp-3UaGyILJweZyfk5BYQp4sGRtIDY,8023
33
+ flutter/flet_charts/lib/src/utils/pie_chart.dart,sha256=7KYpZbJS-PsCt5hpwu0g43kRswkvbEDFm_FGmCJC_fk,1796
34
+ flutter/flet_charts/lib/src/utils/scatter_chart.dart,sha256=uT3IgQL5-JFWtP7pxao9K9KxzTMnsHLkIZ3hpEmw-3I,3322
35
+ flet_charts-0.2.0.dev40.dist-info/METADATA,sha256=27J8I5UuGVZRSi5txyY1VJnKmC62OwJTUXMuvs19p_c,2175
36
+ flet_charts-0.2.0.dev40.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
37
+ flet_charts-0.2.0.dev40.dist-info/top_level.txt,sha256=CVHmtljbPFTyfCiru5bxX1vvWL8L6rtUbV9bqqkSxFE,20
38
+ flet_charts-0.2.0.dev40.dist-info/RECORD,,
@@ -84,9 +84,10 @@ BarTouchTooltipData? parseBarTouchTooltipData(
84
84
  BarTooltipItem? parseBarTooltipItem(Control rod, BuildContext context) {
85
85
  if (!rod.getBool("show_tooltip", true)!) return null;
86
86
 
87
- final theme = Theme.of(context);
87
+ var tooltip = rod.internals?["tooltip"];
88
+ if (tooltip == null) return null;
88
89
 
89
- var tooltip = rod.get("tooltip");
90
+ final theme = Theme.of(context);
90
91
  var tooltipTextStyle =
91
92
  parseTextStyle(tooltip["text_style"], theme, const TextStyle())!;
92
93
  if (tooltipTextStyle.color == null) {