Skip to content

Commit e9c10ee

Browse files
committed
Minor fix for chart string category that evaluates to number.
Closes #907
1 parent b092100 commit e9c10ee

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

xlsxwriter/chart.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -872,8 +872,9 @@ def _get_data_type(self, data):
872872
if token is None:
873873
continue
874874

875-
# Check for strings like '1.1_1' which would evaluate to float.
876-
if type(token) == str and '_' in token:
875+
# Check for strings that would evaluate to float like
876+
#'1.1_1' of ' 1'.
877+
if type(token) == str and re.search('[_ ]', token):
877878
# Assume entire data series is string data.
878879
return 'str'
879880

0 commit comments

Comments
 (0)