Skip to content

Commit b148f08

Browse files
committed
Adjusted value validation in PieDataLabel.distance. Closes #192.
1 parent 69e465c commit b148f08

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

highcharts_core/utility_classes/data_labels.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ def distance(self) -> Optional[int | float | Decimal | str]:
946946

947947
@distance.setter
948948
def distance(self, value):
949-
if not value:
949+
if value is None:
950950
self._distance = None
951951
else:
952952
try:
@@ -955,6 +955,8 @@ def distance(self, value):
955955
if not isinstance(value, str):
956956
raise errors.HighchartsValueError(f'distance must be a number or a string, but received '
957957
f'{type(value).__name__}.')
958+
if value == '':
959+
value = None
958960

959961
self._distance = value
960962

0 commit comments

Comments
 (0)