title: using morris chart in django
body: <p>I am trying to use a morris chart in django. morris chart requires a data in format</p>
  
  <pre><code>$(Morris.Bar({
    element: 'mchart',
    data: [
      { y: '2006', a: 120 },
      { y: '2007', a: 75 },
      { y: '2008', a: 50 },
      { y: '2009', a: 75 },
      { y: '2010', a: 50 },
      { y: '2011', a: 95 },
      { y: '2012', a: 100 }
    ],
    xkey: 'y',
    ykeys: ['a' ],
    labels: ['SMS count']
  }));
  </code></pre>
  
  <p>I have a model named log as
  class Log(models.Model):</p>
  
  <pre><code>   date= models.DateField()
     count=models.CharField(max_length=100)
  </code></pre>
  
  <p>and i used class view to access the data as</p>
  
  <p><strong>views</strong></p>
  
  <pre><code>class newChartView(TemplateView):
      template_name = "new_report_view.html"
  
      def get_context_data(self, **kwargs):
          context = super(newChartView, self).get_context_data(**kwargs)
          context['count'] = Log.objects.all()
          return context
  </code></pre>
  
  <p>now how to arrange the data in to as required by morris.</p>