layrz-sdk 3.1.14__py3-none-any.whl → 3.1.16__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 layrz-sdk might be problematic. Click here for more details.
- layrz_sdk/__init__.py +1 -1
- layrz_sdk/constants.py +19 -5
- layrz_sdk/entities/__init__.py +138 -129
- layrz_sdk/entities/asset.py +76 -60
- layrz_sdk/entities/asset_operation_mode.py +31 -31
- layrz_sdk/entities/broadcast_request.py +12 -12
- layrz_sdk/entities/broadcast_response.py +12 -12
- layrz_sdk/entities/broadcast_result.py +20 -20
- layrz_sdk/entities/broadcast_status.py +28 -28
- layrz_sdk/entities/case.py +52 -52
- layrz_sdk/entities/case_ignored_status.py +26 -26
- layrz_sdk/entities/case_status.py +23 -23
- layrz_sdk/entities/charts/axis_config.py +15 -15
- layrz_sdk/entities/charts/bar_chart.py +175 -175
- layrz_sdk/entities/charts/chart_alignment.py +27 -27
- layrz_sdk/entities/charts/chart_color.py +44 -44
- layrz_sdk/entities/charts/chart_configuration.py +10 -10
- layrz_sdk/entities/charts/chart_data_serie.py +19 -19
- layrz_sdk/entities/charts/chart_data_serie_type.py +28 -28
- layrz_sdk/entities/charts/chart_data_type.py +27 -27
- layrz_sdk/entities/charts/chart_render_technology.py +30 -30
- layrz_sdk/entities/charts/column_chart.py +201 -201
- layrz_sdk/entities/charts/html_chart.py +38 -38
- layrz_sdk/entities/charts/line_chart.py +248 -248
- layrz_sdk/entities/charts/map_center_type.py +22 -22
- layrz_sdk/entities/charts/map_chart.py +108 -108
- layrz_sdk/entities/charts/map_point.py +22 -22
- layrz_sdk/entities/charts/number_chart.py +54 -54
- layrz_sdk/entities/charts/pie_chart.py +131 -131
- layrz_sdk/entities/charts/radar_chart.py +81 -81
- layrz_sdk/entities/charts/radial_bar_chart.py +131 -131
- layrz_sdk/entities/charts/scatter_chart.py +210 -210
- layrz_sdk/entities/charts/scatter_serie.py +13 -13
- layrz_sdk/entities/charts/scatter_serie_item.py +8 -8
- layrz_sdk/entities/charts/table_chart.py +54 -54
- layrz_sdk/entities/charts/table_header.py +8 -8
- layrz_sdk/entities/charts/table_row.py +9 -9
- layrz_sdk/entities/charts/timeline_chart.py +79 -79
- layrz_sdk/entities/charts/timeline_serie.py +10 -10
- layrz_sdk/entities/charts/timeline_serie_item.py +12 -12
- layrz_sdk/entities/checkpoint.py +17 -17
- layrz_sdk/entities/comment.py +16 -16
- layrz_sdk/entities/custom_field.py +10 -10
- layrz_sdk/entities/custom_report_page.py +40 -40
- layrz_sdk/entities/device.py +18 -13
- layrz_sdk/entities/event.py +23 -23
- layrz_sdk/entities/geofence.py +11 -11
- layrz_sdk/entities/last_message.py +12 -12
- layrz_sdk/entities/message.py +23 -23
- layrz_sdk/entities/modbus/__init__.py +9 -0
- layrz_sdk/entities/modbus/config.py +19 -0
- layrz_sdk/entities/modbus/parameter.py +110 -0
- layrz_sdk/entities/modbus/schema.py +10 -0
- layrz_sdk/entities/modbus/status.py +16 -0
- layrz_sdk/entities/modbus/wait.py +134 -0
- layrz_sdk/entities/outbound_service.py +10 -10
- layrz_sdk/entities/position.py +116 -116
- layrz_sdk/entities/presence_type.py +16 -16
- layrz_sdk/entities/report.py +289 -289
- layrz_sdk/entities/report_col.py +40 -40
- layrz_sdk/entities/report_configuration.py +8 -8
- layrz_sdk/entities/report_data_type.py +28 -28
- layrz_sdk/entities/report_format.py +27 -27
- layrz_sdk/entities/report_header.py +43 -43
- layrz_sdk/entities/report_page.py +15 -15
- layrz_sdk/entities/report_row.py +28 -28
- layrz_sdk/entities/sensor.py +11 -11
- layrz_sdk/entities/static_position.py +17 -0
- layrz_sdk/entities/telemetry/__init__.py +6 -0
- layrz_sdk/entities/telemetry/assetmessage.py +159 -0
- layrz_sdk/entities/telemetry/devicemessage.py +122 -0
- layrz_sdk/entities/text_alignment.py +26 -26
- layrz_sdk/entities/trigger.py +11 -11
- layrz_sdk/entities/user.py +10 -10
- layrz_sdk/entities/waypoint.py +18 -18
- layrz_sdk/helpers/__init__.py +5 -5
- layrz_sdk/helpers/color.py +44 -44
- layrz_sdk/lcl/__init__.py +5 -5
- layrz_sdk/lcl/core.py +848 -848
- {layrz_sdk-3.1.14.dist-info → layrz_sdk-3.1.16.dist-info}/METADATA +54 -49
- layrz_sdk-3.1.16.dist-info/RECORD +85 -0
- {layrz_sdk-3.1.14.dist-info → layrz_sdk-3.1.16.dist-info}/licenses/LICENSE +6 -6
- layrz_sdk-3.1.14.dist-info/RECORD +0 -75
- {layrz_sdk-3.1.14.dist-info → layrz_sdk-3.1.16.dist-info}/WHEEL +0 -0
- {layrz_sdk-3.1.14.dist-info → layrz_sdk-3.1.16.dist-info}/top_level.txt +0 -0
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
"""Radar chart"""
|
|
2
|
-
|
|
3
|
-
import sys
|
|
4
|
-
from typing import Any
|
|
5
|
-
|
|
6
|
-
from pydantic import BaseModel, Field
|
|
7
|
-
|
|
8
|
-
from .chart_alignment import ChartAlignment
|
|
9
|
-
from .chart_data_serie import ChartDataSerie
|
|
10
|
-
from .chart_data_serie_type import ChartDataSerieType
|
|
11
|
-
|
|
12
|
-
if sys.version_info >= (3, 11):
|
|
13
|
-
from typing import Self
|
|
14
|
-
else:
|
|
15
|
-
from typing_extensions import Self
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class RadarChart(BaseModel):
|
|
19
|
-
"""Radar chart configuration"""
|
|
20
|
-
|
|
21
|
-
x_axis: ChartDataSerie = Field(description='X Axis of the chart')
|
|
22
|
-
y_axis: list[ChartDataSerie] = Field(description='Y Axis of the chart', default_factory=list)
|
|
23
|
-
title: str = Field(description='Title of the chart', default='Chart')
|
|
24
|
-
align: ChartAlignment = Field(description='Alignment of the chart', default=ChartAlignment.CENTER)
|
|
25
|
-
|
|
26
|
-
def render(self: Self) -> dict[str, Any]:
|
|
27
|
-
"""
|
|
28
|
-
Render chart to a graphic Library.
|
|
29
|
-
|
|
30
|
-
:param technology: The technology to use to render the chart.
|
|
31
|
-
:type technology: ChartRenderTechnology
|
|
32
|
-
|
|
33
|
-
:return: The configuration of the chart.
|
|
34
|
-
:rtype: dict[str, Any]
|
|
35
|
-
"""
|
|
36
|
-
return {'library': 'APEXCHARTS', 'configuration': self._render_apexcharts()}
|
|
37
|
-
|
|
38
|
-
def _render_apexcharts(self: Self) -> dict[str, Any]:
|
|
39
|
-
"""
|
|
40
|
-
Converts the configuration of the chart to Javascript library ApexCharts.
|
|
41
|
-
"""
|
|
42
|
-
|
|
43
|
-
series = []
|
|
44
|
-
colors = []
|
|
45
|
-
|
|
46
|
-
for serie in self.y_axis:
|
|
47
|
-
modified_serie = {'name': serie.label, 'data': serie.data}
|
|
48
|
-
|
|
49
|
-
if serie.serie_type is not ChartDataSerieType.NONE:
|
|
50
|
-
modified_serie['type'] = serie.serie_type.value
|
|
51
|
-
|
|
52
|
-
series.append(modified_serie)
|
|
53
|
-
colors.append(serie.color)
|
|
54
|
-
|
|
55
|
-
config = {
|
|
56
|
-
'series': series,
|
|
57
|
-
'colors': colors,
|
|
58
|
-
'xaxis': {
|
|
59
|
-
'categories': self.x_axis.data,
|
|
60
|
-
'type': self.x_axis.data_type.value,
|
|
61
|
-
'title': {
|
|
62
|
-
'text': self.x_axis.label,
|
|
63
|
-
'style': {'fontFamily': 'Fira Sans Condensed', 'fontSize': '20px', 'fontWeight': 'normal'},
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
'title': {
|
|
67
|
-
'text': self.title,
|
|
68
|
-
'align': self.align.value,
|
|
69
|
-
'style': {'fontFamily': 'Fira Sans Condensed', 'fontSize': '20px', 'fontWeight': 'normal'},
|
|
70
|
-
},
|
|
71
|
-
'chart': {
|
|
72
|
-
'type': 'radar',
|
|
73
|
-
'animations': {'enabled': False},
|
|
74
|
-
'toolbar': {'show': False},
|
|
75
|
-
'zoom': {'enabled': False},
|
|
76
|
-
},
|
|
77
|
-
'dataLabels': {'enabled': True},
|
|
78
|
-
'plotOptions': {'bar': {'horizontal': True, 'borderRadius': 4}},
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return config
|
|
1
|
+
"""Radar chart"""
|
|
2
|
+
|
|
3
|
+
import sys
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, Field
|
|
7
|
+
|
|
8
|
+
from .chart_alignment import ChartAlignment
|
|
9
|
+
from .chart_data_serie import ChartDataSerie
|
|
10
|
+
from .chart_data_serie_type import ChartDataSerieType
|
|
11
|
+
|
|
12
|
+
if sys.version_info >= (3, 11):
|
|
13
|
+
from typing import Self
|
|
14
|
+
else:
|
|
15
|
+
from typing_extensions import Self
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class RadarChart(BaseModel):
|
|
19
|
+
"""Radar chart configuration"""
|
|
20
|
+
|
|
21
|
+
x_axis: ChartDataSerie = Field(description='X Axis of the chart')
|
|
22
|
+
y_axis: list[ChartDataSerie] = Field(description='Y Axis of the chart', default_factory=list)
|
|
23
|
+
title: str = Field(description='Title of the chart', default='Chart')
|
|
24
|
+
align: ChartAlignment = Field(description='Alignment of the chart', default=ChartAlignment.CENTER)
|
|
25
|
+
|
|
26
|
+
def render(self: Self) -> dict[str, Any]:
|
|
27
|
+
"""
|
|
28
|
+
Render chart to a graphic Library.
|
|
29
|
+
|
|
30
|
+
:param technology: The technology to use to render the chart.
|
|
31
|
+
:type technology: ChartRenderTechnology
|
|
32
|
+
|
|
33
|
+
:return: The configuration of the chart.
|
|
34
|
+
:rtype: dict[str, Any]
|
|
35
|
+
"""
|
|
36
|
+
return {'library': 'APEXCHARTS', 'configuration': self._render_apexcharts()}
|
|
37
|
+
|
|
38
|
+
def _render_apexcharts(self: Self) -> dict[str, Any]:
|
|
39
|
+
"""
|
|
40
|
+
Converts the configuration of the chart to Javascript library ApexCharts.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
series = []
|
|
44
|
+
colors = []
|
|
45
|
+
|
|
46
|
+
for serie in self.y_axis:
|
|
47
|
+
modified_serie = {'name': serie.label, 'data': serie.data}
|
|
48
|
+
|
|
49
|
+
if serie.serie_type is not ChartDataSerieType.NONE:
|
|
50
|
+
modified_serie['type'] = serie.serie_type.value
|
|
51
|
+
|
|
52
|
+
series.append(modified_serie)
|
|
53
|
+
colors.append(serie.color)
|
|
54
|
+
|
|
55
|
+
config = {
|
|
56
|
+
'series': series,
|
|
57
|
+
'colors': colors,
|
|
58
|
+
'xaxis': {
|
|
59
|
+
'categories': self.x_axis.data,
|
|
60
|
+
'type': self.x_axis.data_type.value,
|
|
61
|
+
'title': {
|
|
62
|
+
'text': self.x_axis.label,
|
|
63
|
+
'style': {'fontFamily': 'Fira Sans Condensed', 'fontSize': '20px', 'fontWeight': 'normal'},
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
'title': {
|
|
67
|
+
'text': self.title,
|
|
68
|
+
'align': self.align.value,
|
|
69
|
+
'style': {'fontFamily': 'Fira Sans Condensed', 'fontSize': '20px', 'fontWeight': 'normal'},
|
|
70
|
+
},
|
|
71
|
+
'chart': {
|
|
72
|
+
'type': 'radar',
|
|
73
|
+
'animations': {'enabled': False},
|
|
74
|
+
'toolbar': {'show': False},
|
|
75
|
+
'zoom': {'enabled': False},
|
|
76
|
+
},
|
|
77
|
+
'dataLabels': {'enabled': True},
|
|
78
|
+
'plotOptions': {'bar': {'horizontal': True, 'borderRadius': 4}},
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return config
|
|
@@ -1,131 +1,131 @@
|
|
|
1
|
-
"""Radial Bar chart"""
|
|
2
|
-
|
|
3
|
-
import sys
|
|
4
|
-
from typing import Any
|
|
5
|
-
|
|
6
|
-
from pydantic import BaseModel, Field
|
|
7
|
-
|
|
8
|
-
from .chart_alignment import ChartAlignment
|
|
9
|
-
from .chart_data_serie import ChartDataSerie
|
|
10
|
-
from .chart_render_technology import ChartRenderTechnology
|
|
11
|
-
|
|
12
|
-
if sys.version_info >= (3, 11):
|
|
13
|
-
from typing import Self
|
|
14
|
-
else:
|
|
15
|
-
from typing_extensions import Self
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class RadialBarChart(BaseModel):
|
|
19
|
-
"""Radial Bar chart configuration"""
|
|
20
|
-
|
|
21
|
-
series: list[ChartDataSerie] = Field(description='List of series to be displayed in the chart', default_factory=list)
|
|
22
|
-
title: str = Field(description='Title of the chart', default='Chart')
|
|
23
|
-
align: ChartAlignment = Field(description='Alignment of the chart', default=ChartAlignment.CENTER)
|
|
24
|
-
|
|
25
|
-
def render(
|
|
26
|
-
self: Self,
|
|
27
|
-
technology: ChartRenderTechnology = ChartRenderTechnology.SYNCFUSION_FLUTTER_CHARTS,
|
|
28
|
-
) -> dict[str, Any]:
|
|
29
|
-
"""
|
|
30
|
-
Render chart to a graphic Library.
|
|
31
|
-
|
|
32
|
-
:param technology: The technology to use to render the chart.
|
|
33
|
-
:type technology: ChartRenderTechnology
|
|
34
|
-
|
|
35
|
-
:return: The configuration of the chart.
|
|
36
|
-
:rtype: dict[str, Any]
|
|
37
|
-
"""
|
|
38
|
-
if technology == ChartRenderTechnology.GRAPHIC:
|
|
39
|
-
return {
|
|
40
|
-
'library': 'GRAPHIC',
|
|
41
|
-
'chart': 'RADIALBAR',
|
|
42
|
-
'configuration': self._render_graphic(),
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if technology == ChartRenderTechnology.APEX_CHARTS:
|
|
46
|
-
return {
|
|
47
|
-
'library': 'APEXCHARTS',
|
|
48
|
-
'chart': 'RADIALBAR',
|
|
49
|
-
'configuration': self._render_apexcharts(),
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
if technology == ChartRenderTechnology.SYNCFUSION_FLUTTER_CHARTS:
|
|
53
|
-
return {
|
|
54
|
-
'library': 'SYNCFUSION_FLUTTER_CHARTS',
|
|
55
|
-
'chart': 'RADIALBAR',
|
|
56
|
-
'configuration': self._render_syncfusion_flutter_charts(),
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return {
|
|
60
|
-
'library': 'FLUTTER',
|
|
61
|
-
'chart': 'TEXT',
|
|
62
|
-
'configuration': [f'Unsupported {technology}'],
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
def _render_syncfusion_flutter_charts(self) -> Any:
|
|
66
|
-
"""
|
|
67
|
-
Converts the configuration of the chart to Syncfusion Flutter Charts.
|
|
68
|
-
"""
|
|
69
|
-
series = []
|
|
70
|
-
|
|
71
|
-
for serie in self.series:
|
|
72
|
-
series.append(
|
|
73
|
-
{
|
|
74
|
-
'label': serie.label,
|
|
75
|
-
'color': serie.color,
|
|
76
|
-
'value': serie.data[0],
|
|
77
|
-
}
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
return {'series': series}
|
|
81
|
-
|
|
82
|
-
def _render_graphic(self) -> Any:
|
|
83
|
-
"""
|
|
84
|
-
Converts the configuration of the chart to a Flutter library Graphic.
|
|
85
|
-
"""
|
|
86
|
-
series = []
|
|
87
|
-
|
|
88
|
-
for serie in self.series:
|
|
89
|
-
series.append(
|
|
90
|
-
{
|
|
91
|
-
'group': serie.label,
|
|
92
|
-
'color': serie.color,
|
|
93
|
-
'value': serie.data[0],
|
|
94
|
-
}
|
|
95
|
-
)
|
|
96
|
-
|
|
97
|
-
return series
|
|
98
|
-
|
|
99
|
-
def _render_apexcharts(self) -> Any:
|
|
100
|
-
"""
|
|
101
|
-
Converts the configuration of the chart to Javascript library ApexCharts.
|
|
102
|
-
"""
|
|
103
|
-
|
|
104
|
-
series = []
|
|
105
|
-
colors = []
|
|
106
|
-
labels = []
|
|
107
|
-
|
|
108
|
-
for serie in self.series:
|
|
109
|
-
series.append(serie.data[0])
|
|
110
|
-
colors.append(serie.color)
|
|
111
|
-
labels.append(serie.label)
|
|
112
|
-
|
|
113
|
-
config = {
|
|
114
|
-
'series': series,
|
|
115
|
-
'colors': colors,
|
|
116
|
-
'labels': labels,
|
|
117
|
-
'title': {
|
|
118
|
-
'text': self.title,
|
|
119
|
-
'align': self.align.value,
|
|
120
|
-
'style': {'fontFamily': 'Fira Sans Condensed', 'fontSize': '20px', 'fontWeight': 'normal'},
|
|
121
|
-
},
|
|
122
|
-
'chart': {
|
|
123
|
-
'type': 'radialBar',
|
|
124
|
-
'animations': {'enabled': False},
|
|
125
|
-
'toolbar': {'show': False},
|
|
126
|
-
'zoom': {'enabled': False},
|
|
127
|
-
},
|
|
128
|
-
'dataLabels': {'enabled': True},
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
return config
|
|
1
|
+
"""Radial Bar chart"""
|
|
2
|
+
|
|
3
|
+
import sys
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, Field
|
|
7
|
+
|
|
8
|
+
from .chart_alignment import ChartAlignment
|
|
9
|
+
from .chart_data_serie import ChartDataSerie
|
|
10
|
+
from .chart_render_technology import ChartRenderTechnology
|
|
11
|
+
|
|
12
|
+
if sys.version_info >= (3, 11):
|
|
13
|
+
from typing import Self
|
|
14
|
+
else:
|
|
15
|
+
from typing_extensions import Self
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class RadialBarChart(BaseModel):
|
|
19
|
+
"""Radial Bar chart configuration"""
|
|
20
|
+
|
|
21
|
+
series: list[ChartDataSerie] = Field(description='List of series to be displayed in the chart', default_factory=list)
|
|
22
|
+
title: str = Field(description='Title of the chart', default='Chart')
|
|
23
|
+
align: ChartAlignment = Field(description='Alignment of the chart', default=ChartAlignment.CENTER)
|
|
24
|
+
|
|
25
|
+
def render(
|
|
26
|
+
self: Self,
|
|
27
|
+
technology: ChartRenderTechnology = ChartRenderTechnology.SYNCFUSION_FLUTTER_CHARTS,
|
|
28
|
+
) -> dict[str, Any]:
|
|
29
|
+
"""
|
|
30
|
+
Render chart to a graphic Library.
|
|
31
|
+
|
|
32
|
+
:param technology: The technology to use to render the chart.
|
|
33
|
+
:type technology: ChartRenderTechnology
|
|
34
|
+
|
|
35
|
+
:return: The configuration of the chart.
|
|
36
|
+
:rtype: dict[str, Any]
|
|
37
|
+
"""
|
|
38
|
+
if technology == ChartRenderTechnology.GRAPHIC:
|
|
39
|
+
return {
|
|
40
|
+
'library': 'GRAPHIC',
|
|
41
|
+
'chart': 'RADIALBAR',
|
|
42
|
+
'configuration': self._render_graphic(),
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if technology == ChartRenderTechnology.APEX_CHARTS:
|
|
46
|
+
return {
|
|
47
|
+
'library': 'APEXCHARTS',
|
|
48
|
+
'chart': 'RADIALBAR',
|
|
49
|
+
'configuration': self._render_apexcharts(),
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if technology == ChartRenderTechnology.SYNCFUSION_FLUTTER_CHARTS:
|
|
53
|
+
return {
|
|
54
|
+
'library': 'SYNCFUSION_FLUTTER_CHARTS',
|
|
55
|
+
'chart': 'RADIALBAR',
|
|
56
|
+
'configuration': self._render_syncfusion_flutter_charts(),
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
'library': 'FLUTTER',
|
|
61
|
+
'chart': 'TEXT',
|
|
62
|
+
'configuration': [f'Unsupported {technology}'],
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
def _render_syncfusion_flutter_charts(self) -> Any:
|
|
66
|
+
"""
|
|
67
|
+
Converts the configuration of the chart to Syncfusion Flutter Charts.
|
|
68
|
+
"""
|
|
69
|
+
series = []
|
|
70
|
+
|
|
71
|
+
for serie in self.series:
|
|
72
|
+
series.append(
|
|
73
|
+
{
|
|
74
|
+
'label': serie.label,
|
|
75
|
+
'color': serie.color,
|
|
76
|
+
'value': serie.data[0],
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
return {'series': series}
|
|
81
|
+
|
|
82
|
+
def _render_graphic(self) -> Any:
|
|
83
|
+
"""
|
|
84
|
+
Converts the configuration of the chart to a Flutter library Graphic.
|
|
85
|
+
"""
|
|
86
|
+
series = []
|
|
87
|
+
|
|
88
|
+
for serie in self.series:
|
|
89
|
+
series.append(
|
|
90
|
+
{
|
|
91
|
+
'group': serie.label,
|
|
92
|
+
'color': serie.color,
|
|
93
|
+
'value': serie.data[0],
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
return series
|
|
98
|
+
|
|
99
|
+
def _render_apexcharts(self) -> Any:
|
|
100
|
+
"""
|
|
101
|
+
Converts the configuration of the chart to Javascript library ApexCharts.
|
|
102
|
+
"""
|
|
103
|
+
|
|
104
|
+
series = []
|
|
105
|
+
colors = []
|
|
106
|
+
labels = []
|
|
107
|
+
|
|
108
|
+
for serie in self.series:
|
|
109
|
+
series.append(serie.data[0])
|
|
110
|
+
colors.append(serie.color)
|
|
111
|
+
labels.append(serie.label)
|
|
112
|
+
|
|
113
|
+
config = {
|
|
114
|
+
'series': series,
|
|
115
|
+
'colors': colors,
|
|
116
|
+
'labels': labels,
|
|
117
|
+
'title': {
|
|
118
|
+
'text': self.title,
|
|
119
|
+
'align': self.align.value,
|
|
120
|
+
'style': {'fontFamily': 'Fira Sans Condensed', 'fontSize': '20px', 'fontWeight': 'normal'},
|
|
121
|
+
},
|
|
122
|
+
'chart': {
|
|
123
|
+
'type': 'radialBar',
|
|
124
|
+
'animations': {'enabled': False},
|
|
125
|
+
'toolbar': {'show': False},
|
|
126
|
+
'zoom': {'enabled': False},
|
|
127
|
+
},
|
|
128
|
+
'dataLabels': {'enabled': True},
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return config
|