Chart js in django not work?

I’m using Django-Chartjs 1.5.0 ( https://pypi.org/project/django-chartjs/ ) in my Django file but out bout appear only JSON file only like this


I need it to appear like this

  • my cod in github link https://github.com/ahmed-solyman/cost
    this is my cod
    view js
    class LineChartJSONView(BaseLineChartView):
    def get_labels(self):
    “”“Return 7 labels for the x-axis.”""
    return [“January”, “February”, “March”, “April”, “May”, “June”, “July”]

    def get_providers(self):
    “”“Return names of datasets.”""
    return [“Central”, “Eastside”, “Westside”]

    def get_data(self):
    “”“Return 3 datasets to plot.”""

      return [[75, 44, 92, 11, 44, 95, 35],
              [41, 92, 18, 3, 73, 87, 92],
              [87, 21, 94, 3, 90, 13, 65]]
    

line_chart = TemplateView.as_view(template_name=‘line_chart.html’)
line_chart_json = LineChartJSONView.as_view()

I can’t seem to track down my old example using charts.js… but it’s definitely possible.

<canvas id="funchart" width="75" height="50"></canvas>                      

<script type="text/javascript">  
     var a = document.getElementById('funchart').getContext('2d');
     var myLineChart = new Chart(a, {
               type: 'line',
               data: {
                   labels:[{% for i in myobject %}{{ i.labels }},{% endfor %}],
                   datasets: [{
                        label:'My Dot',
                        data: [{% for i in myobject %}{{ i.data }},{% endfor %}]
                             }]
                      },
               options:{
                   scales: {
                       xAxes: [{
                           display:true
                              }],
                       yAxes: [{
                           ticks: {
                               beginAtZero:true
                                   }
                               }]
                            }
                        }
                      });
</script>

This is an example from stack overflow: https://stackoverflow.com/questions/51003311/django-and-chartjs

It looks like the data and labels are being passed to the chart object in their working example. Your example does not seem to do so… not saying that makes it invalid but I would try passing data and labels.