Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #47 from mpena2099/master
Properly handle unicode data.
  • Loading branch information
atodorov committed Jan 10, 2017
2 parents 6712faa + 4a73016 commit 2c0da34
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion chartit/charts.py
Expand Up @@ -11,6 +11,12 @@
import json


# in Python 3 the standard str type is unicode and the
# unicode type has been removed so define the keyword here
if sys.version_info.major >= 3:
unicode = str


class BaseChart(object):
"""
Common ancestor class for all charts to avoid code duplication.
Expand Down Expand Up @@ -391,7 +397,7 @@ def cht_typ_grp(y_term):
for x_value, y_value_tuple in data:
for opts, y_value in zip(y_hco_list,
y_value_tuple):
opts['data'].append((str(x_value),
opts['data'].append((unicode(x_value),
y_value))
self.hcoptions['series'].extend(y_hco_list)

Expand Down

0 comments on commit 2c0da34

Please sign in to comment.