flet-charts 0.2.0.dev40__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.

@@ -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, ChartHorizontalAlignment
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,56 +24,58 @@ class ScatterChartTooltip:
24
24
  The tooltip's border radius.
25
25
  """
26
26
 
27
- padding: Optional[ft.PaddingValue] = None
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: Optional[ft.Number] = None
34
+ max_width: ft.Number = 120
33
35
  """
34
36
  Restricts the tooltip's width.
35
37
  """
36
38
 
37
- rotate_angle: Optional[ft.Number] = None
39
+ rotation: ft.Number = 0.0
38
40
  """
39
41
  The tooltip's rotation angle in degrees.
40
42
  """
41
43
 
42
- horizontal_offset: Optional[ft.Number] = None
44
+ horizontal_offset: ft.Number = 0
43
45
  """
44
46
  Applies horizontal offset for showing tooltip.
45
47
  """
46
48
 
47
- horizontal_alignment: Optional[ChartHorizontalAlignment] = None
49
+ horizontal_alignment: HorizontalAlignment = HorizontalAlignment.CENTER
48
50
  """
49
51
  The tooltip's horizontal alignment.
50
52
  """
51
53
 
52
- border_side: Optional[ft.BorderSide] = None
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: Optional[bool] = None
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: Optional[bool] = None
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
 
67
- def copy_with(
69
+ def copy(
68
70
  self,
69
71
  *,
70
72
  bgcolor: Optional[ft.ColorValue] = None,
71
73
  border_radius: Optional[ft.BorderRadiusValue] = None,
72
74
  padding: Optional[ft.PaddingValue] = None,
73
75
  max_width: Optional[ft.Number] = None,
74
- rotate_angle: Optional[ft.Number] = None,
76
+ rotation: Optional[ft.Number] = None,
75
77
  horizontal_offset: Optional[ft.Number] = None,
76
- horizontal_alignment: Optional[ChartHorizontalAlignment] = None,
78
+ horizontal_alignment: Optional[HorizontalAlignment] = None,
77
79
  border_side: Optional[ft.BorderSide] = None,
78
80
  fit_inside_horizontally: Optional[bool] = None,
79
81
  fit_inside_vertically: Optional[bool] = None,
@@ -88,9 +90,7 @@ class ScatterChartTooltip:
88
90
  else self.border_radius,
89
91
  padding=padding if padding is not None else self.padding,
90
92
  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,
93
+ rotation=rotation if rotation is not None else self.rotation,
94
94
  horizontal_offset=horizontal_offset
95
95
  if horizontal_offset is not None
96
96
  else self.horizontal_offset,
@@ -111,12 +111,12 @@ class ScatterChartTooltip:
111
111
  class ScatterChartEvent(ft.Event["ScatterChart"]):
112
112
  type: ChartEventType
113
113
  """
114
- Type of the event (e.g. tapDown, panUpdate)
114
+ The type of the event that occurred.
115
115
  """
116
116
 
117
117
  spot_index: Optional[int] = None
118
118
  """
119
- Index of the touched spot, if any
119
+ The index of the touched spot, if any.
120
120
  """
121
121
 
122
122
 
@@ -141,9 +141,6 @@ class ScatterChart(ft.ConstrainedControl):
141
141
  )
142
142
  """
143
143
  Controls chart implicit animation.
144
-
145
- Value is of [`AnimationValue`](https://flet.dev/docs/reference/types/animationvalue)
146
- type.
147
144
  """
148
145
 
149
146
  interactive: bool = True
@@ -151,11 +148,6 @@ class ScatterChart(ft.ConstrainedControl):
151
148
  Enables automatic tooltips when hovering chart bars.
152
149
  """
153
150
 
154
- handle_built_in_touches: bool = True
155
- """
156
- Whether to show a tooltip popup on top of the spots if a touch occurs.
157
- """
158
-
159
151
  long_press_duration: Optional[ft.DurationValue] = None
160
152
  """
161
153
  The duration of a long press on the chart.
@@ -231,14 +223,27 @@ class ScatterChart(ft.ConstrainedControl):
231
223
  The maximum displayed value for Y axis.
232
224
  """
233
225
 
234
- tooltip: Optional[ScatterChartTooltip] = None
226
+ tooltip: ScatterChartTooltip = field(default_factory=lambda: ScatterChartTooltip())
235
227
  """
236
228
  The tooltip configuration for the chart.
237
229
  """
238
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
+
239
244
  on_event: Optional[ft.EventHandler[ScatterChartEvent]] = None
240
245
  """
241
- Fires when an event occurs on the chart.
246
+ Called when an event occurs on this chart.
242
247
  """
243
248
 
244
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,13 +21,20 @@ class ScatterChartSpotTooltip(ChartDataPointTooltip):
21
21
  When `None`, defaults to [`ScatterChartSpot.y`][(p).].
22
22
  """
23
23
 
24
- def copy_with(
24
+ bottom_margin: ft.Number = 8
25
+ """
26
+ The bottom space from the spot.
27
+ """
28
+
29
+ def copy(
25
30
  self,
26
31
  *,
27
32
  text: Optional[str] = None,
28
33
  text_style: Optional[ft.TextStyle] = None,
29
34
  text_align: Optional[ft.TextAlign] = None,
30
35
  text_spans: Optional[list[ft.TextSpan]] = None,
36
+ rtl: Optional[bool] = None,
37
+ bottom_margin: Optional[float] = None,
31
38
  ) -> "ScatterChartSpotTooltip":
32
39
  """
33
40
  Returns a copy of this object with the specified properties overridden.
@@ -39,6 +46,10 @@ class ScatterChartSpotTooltip(ChartDataPointTooltip):
39
46
  text_spans=text_spans.copy()
40
47
  if text_spans is not None
41
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,
42
53
  )
43
54
 
44
55
 
@@ -107,12 +118,12 @@ class ScatterChartSpot(ft.BaseControl):
107
118
  Wether to show the tooltip.
108
119
  """
109
120
 
110
- label_text: Optional[str] = None
121
+ label_text: str = ""
111
122
  """
112
123
  TBD
113
124
  """
114
125
 
115
- label_style: Optional[ft.TextStyle] = None
126
+ label_text_style: ft.TextStyle = field(default_factory=lambda: ft.TextStyle())
116
127
  """
117
128
  TBD
118
129
  """
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,7 +45,7 @@ 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(
48
+ def copy(
49
49
  self,
50
50
  *,
51
51
  interval: Optional[ft.Number] = None,
@@ -108,7 +108,7 @@ class ChartCirclePoint(ChartPointShape):
108
108
  def __post_init__(self):
109
109
  self._type = "ChartCirclePoint"
110
110
 
111
- def copy_with(
111
+ def copy(
112
112
  self,
113
113
  *,
114
114
  color: Optional[ft.ColorValue] = None,
@@ -158,7 +158,7 @@ class ChartSquarePoint(ChartPointShape):
158
158
  def __post_init__(self):
159
159
  self._type = "ChartSquarePoint"
160
160
 
161
- def copy_with(
161
+ def copy(
162
162
  self,
163
163
  *,
164
164
  color: Optional[ft.ColorValue] = None,
@@ -183,7 +183,7 @@ class ChartSquarePoint(ChartPointShape):
183
183
 
184
184
  @dataclass
185
185
  class ChartCrossPoint(ChartPointShape):
186
- """Draws a cross-mark(X)."""
186
+ """Draws a cross-mark (X)."""
187
187
 
188
188
  color: Optional[ft.ColorValue] = None
189
189
  """
@@ -204,7 +204,7 @@ class ChartCrossPoint(ChartPointShape):
204
204
  def __post_init__(self):
205
205
  self._type = "ChartCrossPoint"
206
206
 
207
- def copy_with(
207
+ def copy(
208
208
  self,
209
209
  *,
210
210
  color: Optional[ft.ColorValue] = None,
@@ -223,7 +223,7 @@ class ChartCrossPoint(ChartPointShape):
223
223
 
224
224
  @dataclass
225
225
  class ChartPointLine:
226
- """"""
226
+ """Defines style of a line."""
227
227
 
228
228
  color: Optional[ft.ColorValue] = None
229
229
  """
@@ -240,12 +240,18 @@ class ChartPointLine:
240
240
  The line's dash pattern.
241
241
  """
242
242
 
243
- def copy_with(
243
+ gradient: Optional[ft.Gradient] = None
244
+ """
245
+ The line's gradient.
246
+ """
247
+
248
+ def copy(
244
249
  self,
245
250
  *,
246
251
  color: Optional[ft.ColorValue] = None,
247
252
  width: Optional[ft.Number] = None,
248
253
  dash_pattern: Optional[list[int]] = None,
254
+ gradient: Optional[ft.Gradient] = None,
249
255
  ) -> "ChartPointLine":
250
256
  """
251
257
  Returns a copy of this object with the specified properties overridden.
@@ -258,6 +264,7 @@ class ChartPointLine:
258
264
  else self.dash_pattern.copy()
259
265
  if self.dash_pattern is not None
260
266
  else None,
267
+ gradient=gradient if gradient is not None else self.gradient,
261
268
  )
262
269
 
263
270
 
@@ -300,47 +307,54 @@ class ChartEventType(Enum):
300
307
 
301
308
  POINTER_ENTER = "pointerEnter"
302
309
  """
303
-
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.
304
312
  """
305
313
 
306
314
  POINTER_HOVER = "pointerHover"
307
315
  """
308
-
316
+ The pointer has moved with respect to the device while the pointer is not
317
+ in contact with the device.
309
318
  """
310
319
 
311
320
  PAN_DOWN = "panDown"
312
321
  """
313
-
322
+ When a pointer has contacted the screen and might begin to move
314
323
  """
315
324
 
316
325
  PAN_START = "panStart"
317
326
  """
318
-
327
+ When a pointer has contacted the screen and has begun to move.
319
328
  """
320
329
 
321
330
  PAN_UPDATE = "panUpdate"
322
331
  """
323
-
332
+ When a pointer that is in contact with the screen and moving
333
+ has moved again.
324
334
  """
325
335
 
326
336
  LONG_PRESS_MOVE_UPDATE = "longPressMoveUpdate"
327
337
  """
328
-
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.
329
341
  """
330
342
 
331
343
  LONG_PRESS_START = "longPressStart"
332
344
  """
333
-
345
+ When a pointer has remained in contact with the screen at the
346
+ same location for a long period of time.
334
347
  """
335
348
 
336
349
  TAP_DOWN = "tapDown"
337
350
  """
338
-
351
+ When a pointer that might cause a tap has contacted the
352
+ screen.
339
353
  """
340
354
 
341
355
  UNDEFINED = "undefined"
342
356
  """
343
-
357
+ An undefined event.
344
358
  """
345
359
 
346
360
 
@@ -352,7 +366,7 @@ class ChartDataPointTooltip:
352
366
 
353
367
  text: Optional[str] = None
354
368
  """
355
- The text to display in the tooltip.
369
+ The text to display in this tooltip.
356
370
  """
357
371
 
358
372
  text_style: ft.TextStyle = field(default_factory=lambda: ft.TextStyle())
@@ -362,21 +376,27 @@ class ChartDataPointTooltip:
362
376
 
363
377
  text_align: ft.TextAlign = ft.TextAlign.CENTER
364
378
  """
365
- An align for the tooltip.
379
+ The text alignment of the tooltip.
366
380
  """
367
381
 
368
382
  text_spans: Optional[list[ft.TextSpan]] = None
369
383
  """
370
- Additional text spans to show on a tooltip.
384
+ Additional text spans to show on this tooltip.
385
+ """
386
+
387
+ rtl: bool = False
388
+ """
389
+ Whether the text is right-to-left.
371
390
  """
372
391
 
373
- def copy_with(
392
+ def copy(
374
393
  self,
375
394
  *,
376
395
  text: Optional[str] = None,
377
396
  text_style: Optional[ft.TextStyle] = None,
378
397
  text_align: Optional[ft.TextAlign] = None,
379
398
  text_spans: Optional[list[ft.TextSpan]] = None,
399
+ rtl: Optional[bool] = None,
380
400
  ) -> "ChartDataPointTooltip":
381
401
  """
382
402
  Returns a copy of this object with the specified properties overridden.
@@ -390,10 +410,11 @@ class ChartDataPointTooltip:
390
410
  else self.text_spans.copy()
391
411
  if self.text_spans is not None
392
412
  else None,
413
+ rtl=rtl if rtl is not None else self.rtl,
393
414
  )
394
415
 
395
416
 
396
- class ChartHorizontalAlignment(Enum):
417
+ class HorizontalAlignment(Enum):
397
418
  """Defines an element's horizontal alignment to given point."""
398
419
 
399
420
  LEFT = "left"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flet-charts
3
- Version: 0.2.0.dev40
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
- ## Installation
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"),
@@ -18,6 +18,8 @@ class ScatterChartControl extends StatefulWidget {
18
18
  class _ScatterChartControlState extends State<ScatterChartControl> {
19
19
  @override
20
20
  Widget build(BuildContext context) {
21
+ debugPrint("ScatterChart build: ${widget.control.id}");
22
+
21
23
  final theme = Theme.of(context);
22
24
  var animation = widget.control.getAnimation(
23
25
  "animation",
@@ -34,11 +36,12 @@ class _ScatterChartControlState extends State<ScatterChartControl> {
34
36
  var interactive = widget.control.getBool("interactive", true)!;
35
37
 
36
38
  // Build list of ScatterSpotData
37
- final spots = widget.control.children('spots').map((spot) {
39
+ final spotsAsControls = widget.control.children('spots');
40
+ final spots = spotsAsControls.map((spot) {
38
41
  var x = spot.getDouble('x', 0)!;
39
42
  var y = spot.getDouble('y', 0)!;
40
43
  return ScatterSpot(x, y,
41
- show: spot.getBool('visible', true)!,
44
+ show: spot.visible,
42
45
  renderPriority: spot.getInt('render_priority', 0)!,
43
46
  xError: spot.get('x_error'),
44
47
  yError: spot.get('y_error'),
@@ -80,30 +83,29 @@ class _ScatterChartControlState extends State<ScatterChartControl> {
80
83
  widget.control.get("vertical_grid_lines"),
81
84
  theme),
82
85
  scatterTouchData: ScatterTouchData(
83
- enabled: interactive,
84
- touchCallback: widget.control.getBool("on_event", false)!
85
- ? (evt, resp) {
86
- var eventData =
87
- ScatterChartEventData.fromDetails(evt, resp);
88
- widget.control.triggerEvent("event", eventData.toMap());
89
- }
90
- : null,
91
- longPressDuration:
92
- widget.control.getDuration("long_press_duration"),
93
- handleBuiltInTouches:
94
- widget.control.getBool("handle_built_in_touches", true)!,
95
- touchTooltipData:
96
- parseScatterTouchTooltipData(context, widget.control, spots)),
86
+ enabled: interactive && !widget.control.disabled,
87
+ touchCallback: widget.control.getBool("on_event", false)!
88
+ ? (evt, resp) {
89
+ var eventData = ScatterChartEventData.fromDetails(evt, resp);
90
+ widget.control.triggerEvent("event", eventData.toMap());
91
+ }
92
+ : null,
93
+ longPressDuration: widget.control.getDuration("long_press_duration"),
94
+ handleBuiltInTouches: !widget.control
95
+ .getBool("show_tooltips_for_selected_spots_only", false)!,
96
+ touchTooltipData:
97
+ parseScatterTouchTooltipData(context, widget.control, spots),
98
+ ),
97
99
  scatterLabelSettings: ScatterLabelSettings(
98
100
  showLabel: true,
99
101
  getLabelFunction: (spotIndex, spot) {
100
- var dp = widget.control.children("spots")[spotIndex];
102
+ var dp = spotsAsControls[spotIndex];
101
103
  return dp.getString("label_text", "")!;
102
104
  },
103
105
  getLabelTextStyleFunction: (spotIndex, spot) {
104
- var dp = widget.control.children("spots")[spotIndex];
106
+ var dp = spotsAsControls[spotIndex];
105
107
  var labelStyle =
106
- dp.getTextStyle("label_style", theme, const TextStyle())!;
108
+ dp.getTextStyle("label_text_style", theme, const TextStyle())!;
107
109
  if (labelStyle.color == null) {
108
110
  labelStyle =
109
111
  labelStyle.copyWith(color: spot.dotPainter.mainColor);
@@ -111,8 +113,7 @@ class _ScatterChartControlState extends State<ScatterChartControl> {
111
113
  return labelStyle;
112
114
  },
113
115
  ),
114
- showingTooltipIndicators: widget.control
115
- .children('spots')
116
+ showingTooltipIndicators: spotsAsControls
116
117
  .asMap()
117
118
  .entries
118
119
  .where((e) => e.value.getBool("selected", false)!)
@@ -64,15 +64,20 @@ BarTouchTooltipData? parseBarTouchTooltipData(
64
64
  getTooltipColor: (BarChartGroupData group) =>
65
65
  parseColor(tooltip["bgcolor"], theme, theme.colorScheme.secondary)!,
66
66
  tooltipBorderRadius: parseBorderRadius(tooltip["border_radius"]),
67
- tooltipMargin: parseDouble(tooltip["margin"]),
68
- tooltipPadding: parsePadding(tooltip["padding"]),
67
+ tooltipMargin: parseDouble(tooltip["margin"], 16)!,
68
+ tooltipPadding: parsePadding(tooltip["padding"],
69
+ const EdgeInsets.symmetric(horizontal: 16, vertical: 8))!,
69
70
  maxContentWidth: parseDouble(tooltip["max_width"]),
70
- rotateAngle: parseDouble(tooltip["rotate_angle"]),
71
- tooltipHorizontalOffset: parseDouble(tooltip["horizontal_offset"]),
71
+ rotateAngle: parseDouble(tooltip["rotation"], 0.0)!,
72
+ tooltipHorizontalOffset: parseDouble(tooltip["horizontal_offset"], 0)!,
72
73
  tooltipBorder: parseBorderSide(tooltip["border_side"], theme),
73
- fitInsideHorizontally: parseBool(tooltip["fit_inside_horizontally"]),
74
- fitInsideVertically: parseBool(tooltip["fit_inside_vertically"]),
75
- direction: parseTooltipDirection(tooltip["direction"]),
74
+ fitInsideHorizontally:
75
+ parseBool(tooltip["fit_inside_horizontally"], false)!,
76
+ fitInsideVertically: parseBool(tooltip["fit_inside_vertically"], false)!,
77
+ direction:
78
+ parseTooltipDirection(tooltip["direction"], TooltipDirection.auto)!,
79
+ tooltipHorizontalAlignment: parseFLHorizontalAlignment(
80
+ tooltip["horizontal_alignment"], FLHorizontalAlignment.center)!,
76
81
  getTooltipItem: (group, groupIndex, rod, rodIndex) {
77
82
  var rod =
78
83
  control.children("groups")[groupIndex].children("rods")[rodIndex];
@@ -98,6 +103,9 @@ BarTooltipItem? parseBarTooltipItem(Control rod, BuildContext context) {
98
103
  return BarTooltipItem(
99
104
  tooltip["text"] ?? rod.getDouble("to_y", 0)!.toString(), tooltipTextStyle,
100
105
  textAlign: parseTextAlign(tooltip["text_align"], TextAlign.center)!,
106
+ textDirection: parseBool(tooltip["rtl"], false)!
107
+ ? TextDirection.rtl
108
+ : TextDirection.ltr,
101
109
  children: tooltip["text_spans"] != null
102
110
  ? parseTextSpans(tooltip["text_spans"], theme, (s, eventName,
103
111
  [eventData]) {
@@ -176,3 +184,11 @@ BarChartRodStackItem parseBarChartRodStackItem(
176
184
  rodStackItem.getBorderSide("border_side", Theme.of(context),
177
185
  defaultValue: BorderSide.none)!);
178
186
  }
187
+
188
+ BarChartAlignment? parseBarChartAlignment(String? value,
189
+ [BarChartAlignment? defaultValue]) {
190
+ if (value == null) return defaultValue;
191
+ return BarChartAlignment.values.firstWhereOrNull(
192
+ (e) => e.name.toLowerCase() == value.toLowerCase()) ??
193
+ defaultValue;
194
+ }