Skip to content

Commit

Permalink
Minor fix for chart string category that evaluates to number.
Browse files Browse the repository at this point in the history
Closes #907
  • Loading branch information
jmcnamara committed Sep 5, 2022
1 parent b092100 commit e9c10ee
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions xlsxwriter/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,8 +872,9 @@ def _get_data_type(self, data):
if token is None:
continue

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

Expand Down

0 comments on commit e9c10ee

Please sign in to comment.