Closed wraithan closed 8 years ago
I should really just make simplejson
a requirement for django_chartit
, because not using decimals makes it too complicated. I will add it to requirements.
alternatively, change the import statement like this:
try: import simplejson except ImportError: try: import json as simplejson except ImportError: from django.utils import simplejson
seems to work for me to get around that particular error, although i get a new error now ("datetime.datetime(2012, 2, 17, 7, 24, 55, tzinfo=
I got the same error: "datetime.date(2012, 5, 22) is not JSON serializable". I am trying to use a DateField on the x-axis instead of the "Month" integer type field used on http://chartit.shutupandship.com/demo/chart/scatter-plot/ and this is what causes the error.
Could someone please explain how can I display the chart using a DateField on the X-Axis?
Unfortunately Chartit still does not support datetime objects as axes.
Is there any way around the datetime issue?
FYI chartit imports simplejson form django.utils.simplejson, not directly. And this is what latest Django says:
warnings.warn("django.utils.simplejson is deprecated; use json instead.", DeprecationWarning, stacklevel=2)
@pgollakota if you put simplejson in requirements. You need to change the import too. "import simplejson"
In the template tag load_charts on line 70 there is use_decimals=True in dumps(). The library uses django's simplejson which gracefully falls back to python's built in json lib which does not have a use_decimals argument to its dumps().