0👍
This error
"TypeError: ‘Organization’ object is not subscriptable django charts.js"
suggests that you are trying to get an element out of an Organization object that isn’t a dictionary
, list
, or a tuple
.
I suspect the likely cause of this may be stemming from the following (though you can confirm this with the full error trace which should tell you the line of code that is causing the error):
for org in orgz:
labels.append(org['country'])
labels.append(org['Total_Scores'])
You should try to debug the values of this and verify that they are correct.
- Chartjs-Chart.js how do we extract clicked var?
- Chartjs-Chart.js: How to display object data types on line graph correctly?
Source:stackexchange.com