Hi,
I want to draw a graph with jqplot, where the x-axis is a date-
timeline, but I get this message:
TypeError: datetime.date(2011, 10, 2) is not JSON serializable
Does anyone know an easy way to pass date variable to json?
Thanks in advance for help. Here is some code from the files:
************
>From the controller file:
points=[[point.thedate, point.value] for point in pointlist]
return dict(points=points)
************
from the view file:
<script>
<!--
jQuery(document).ready(function() {
$.jqplot('chart1', [{{=simplejson.dumps(points)}}], {
title:'Default Date Axis',
axes:{xaxis:{renderer:$.jqplot.DateAxisRenderer}},
series:[{lineWidth:4, markerOptions:{style:'square'}}]
});
});
-->
</script>
<div id="chart1" style="margin-top:20px;margin-left:20px; width:200px;
height:200px;">
</div>