Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def salesboard(request):
- # render the graph here
- data = [
- ['Year', 'Sales', 'Expenses'],
- [2004, 1000, 400],
- [2005, 1170, 460],
- [2006, 660, 1120],
- [2007, 1030, 540]
- ]
- chart = flot.LineChart(SimpleDataSource(data=data), html_id="Line Chart")
- return render_to_response('scoreboard.html', {'chart':chart})
- Error during template rendering
- In template C:UsersTIMLEU~1DesktopSYSTEM~1sp-venvlibsite-packagesgraphostemplatesgraphosflot.html, error at line 4
- <zip object at 0x00000052AAC8D448> is not JSON serializable
- 1 <div id="{{ chart.html_id }}" style="width:{{ chart.width }}px;height:{{ chart.height }}px;"></div>
- 2 <script type="text/javascript">
- 3 $(function () {
- 4 data{{ chart.html_id }} = {{ chart.get_series_objects_json|safe }}
- 5 $plot{{ chart.html_id }} = $.plot(
- 6 $("#{{ chart.html_id }}"),
- 7 data{{ chart.html_id }},
- 8 {{ chart.get_options_json|safe }}
- 9 );
- 10 });
- 11 </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement