I'm trying to incorporate a highcharts solidgauge (https://www.highcharts.com/demo/gauge-solid) into my Django and Python3.8 app. However, most of the examples I have come across are designed for Angular.
tldr: I keep receiving a red error message from highcharts (No. 17), stating that the requested series type does not exist.
Here's the detailed version: Without much guidance, I downloaded four JavaScript files (, , , and ). I placed them in my Django's static folder and ran manage.py collectstatic.
In my views.py file, I attempted to replicate an example from the highcharts page, but I am unable to get it to render properly. The code snippet looks like this:
def landingpage(request):
chart = {
'chart': {
'type':'solidgauge',
},
'title': {'text':'Example gauge'},
// more chart configuration here...
}
}
dump = json.dumps(chart, cls=CustomJsonEncoder)
gauge = {'chart':dump}
context['chart_example'] = gauge['chart']
return render(request, templ_folder_name + 'landingpage.html', context)
// Custom JSON Encoder class definition here...
Within my template file, I have included this:
{% block content %}
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<h2 class="page-header">Dashboard</h2>
<br>
// rest of the template structure...
<br>
</div>
{% load static %}
// script tags loading required JS files and initializing Highcharts
{% endblock %}
Can someone please point out where I might be making a mistake?
Update: I am not familiar with using developer tools in Firefox, but I managed to capture a screenshot of the error message displayed. Check it out https://i.sstatic.net/wSM0P.png.