I am trying to create data visualization dashboard in a django project am working on, i am using highchart js to achieve this.My problem is even after following the documentation, my data is not been displayed even as a simple line chart.I am sure am missing something, kindly need help.
my models
class Company(models.Model):
name = models.CharField(max_length=100)
phone = models.CharField(max_length=50)
email = models.EmailField(max_length=75)
city = models.ForeignKey(City)
sector = models.ForeignKey(Sector)
description = models.TextField()
def __unicode__(self):
return self.name
class Feedback(models.Model):
PENDING,RESOLVED = range(2)
FEEDBACK_STATUS = (
(PENDING,'Pending'),
(RESOLVED, 'Resolved'),
)
title = models.CharField(max_length=100)
feed_back = models.TextField(verbose_name='feed back')
date_posted = models.DateTimeField(verbose_name='date posted',auto_now_add=True)
customer = models.ForeignKey(Customer)
company = models.ForeignKey(Company)
status = models.PositiveSmallIntegerField(null = True ,choices=FEEDBACK_STATUS, blank = True)
# status = models.BooleanField(default=False)
objects = FeedbackManager()
def __unicode__(self):
return self.title
views.py
def chart_data(request):
"""
this model holds the data visualization datasets
"""
company = Company.objects.get(pk=1)
feedbacks = Feedback.objects.filter(company=company)
feeds = feedbacks.count()
return render_to_response('cfback/dashboard.html',RequestContext(request, {'company':company,
'feeds':feeds}))
and on the template side i have the following code base.html https://codeshare.io/5w9wDD
and the dashboard.html is https://codeshare.io/5zlKvk
you'll note on the dashboard.html i am testing with on of the demo charts from highcharts and calling a variable from my model to test if anything is been displayed the rest are values from the demo app.
xAxis: {
categories: [{{company}},{{company}},{{company}},{{company}},{{company}}],
title: {
text: null
}
some kindly help to figure out what am missing, i have been on this for the last 2 days.I am almost giving up on highcharts and try something else. Thanks