Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
0 answers
56 views

Bar Chart Not Stacking

I have been trying to adapt this tutorial, How to Use Chart.js with Django, to my AWS billing reports. I want to tweak this graph from the tutorial: I want to "stack" the costs from the ...
Red Cricket's user avatar
  • 10.4k
0 votes
0 answers
31 views

Migrate chart.js <script> functions to django views while maintaining dynamic interactivity on all charts

I have a django app that has a significant amount of user interaction with the user. The User uses sliders and text boxes to move data points, and the chart automatically changes and recalculates all ...
dassouki's user avatar
  • 6,366
0 votes
0 answers
47 views

Cant pass data to Chart.js with Django

Im using bootstrap template for my website and have problem to pass data from view in django to html to chart.js I tried to pass data like any other variable but it didnt worked. I cant see data I ...
Marcin Sommer's user avatar
0 votes
0 answers
133 views

Fetching Data from PostgreSQL DB and displaying in form of pie chart in Django App

I am trying to fetch the data from Progress Table(Model) that is in my PostgreSQL database.. but it shows nothing where I want to show that data in form of pie-chart. the only error it gives is ...
saba fatima's user avatar
0 votes
2 answers
287 views

How to pass dictionary data to chart.js in django?

I want to get a report by chart from my model but I can't figured out how to pass data from a dictionary to chart using chart.js? here is my model: class Book(models.Model): number = models....
mosleh azizi's user avatar
2 votes
1 answer
69 views

How to make a complex query? | ChartJS and Django

I have a chart created using Chart JS library below: My models.py below: class Organization(models.Model): name = models.CharField(max_length=250, unique=True) def __str__(self): ...
Firdavsbek Narzullaev's user avatar
0 votes
1 answer
30 views

Django App: Chart.js is ignoring my options

Why is my Chart.js code ignoring the options I am setting? I am attemptint to plot a simple chart with two variables that should appear on two y axes. I tried to hide the secondary y axis (which, ...
Gian L's user avatar
  • 5
0 votes
1 answer
130 views

Fail to show date array in chart.js labels/x-axis in Django

I have a django project where a model called EmployeeDayOutput is created with 2 columns output_date (datetime or date field both work) and output_hours (float). In a html page I use chart.js to ...
Schumann's user avatar
0 votes
0 answers
41 views

django-chartjs issue. chart not displaying on the page

I am currently trying to display a bar chart in my django application this chart is supposed to represent the total mortality rate of all hospitals I have in the database. I can see the data when I ...
D12's user avatar
  • 1
0 votes
1 answer
142 views

Make a pie chart using chart.js in Django error

I am building a budget tracker application and in dashboard page, I'd like to list different graphs. The pie chart is for expense structure showing how much expense is spent in certain categories. I'm ...
Jae's user avatar
  • 47
0 votes
0 answers
88 views

Django - How to track user progress across multiple days?

I have a django model that updates with the user's current time spent on the website: totallearningtime = models.DecimalField(default = 0, decimal_places=2, max_digits=100) # total time user spent on ...
Jahan Manu's user avatar
0 votes
1 answer
442 views

Javascript doesn't execute when the html is called by a hx-get

I have the following html's that i load in a Django app: pie_chart.html {% load i18n %} <div id="chartcontainer" > <div style= "width: 400px;" "height: 400px;&...
PaulR's user avatar
  • 45
2 votes
1 answer
519 views

How to query database and display on charts.js in django

Hi I am trying to display all marketplace as label and the quantity of infringements in those marketplace as data on a pie chart. Please help. marketplace1 - 5 marketplae2 -4 marketplace3 -7 dashboard....
Farid's user avatar
  • 130
1 vote
2 answers
325 views

Problem using npm of chart.js in django Project

I tried to use Chart.js in my Django project , when I Use NPM package it's not working but when I use CDN It work Perfectly char.js version 3.9.1 here is my index.html file on my project <!DOCTYPE ...
alfred's user avatar
  • 15
0 votes
0 answers
106 views

Chart.js display no data message using django

I have a pie chart that I want to display no data message when there is no data to be shown I have tried the methods here but it seems to stop displaying the chart all together even when there is data....
L30N3CH0's user avatar
1 vote
2 answers
2k views

Chart.js- Dates not displaying correctly on chart and axis labels not showing

I'm trying to label my axes on my chart. I'm using chart.js v3.9.1 and I believe I've followed the documentation, however the labels aren't showing up (see below): health_hub_tracker.html: {% extends '...
BenD2525's user avatar
1 vote
1 answer
3k views

Why is Chart.js not rendering? Error: Uncaught ReferenceError: Chart is not defined

I am trying to implement chart.js in my django project, and I am starting with the example graph used on the chart.js website, before then amending the data and tweaking it. However, I can't yet get ...
BenD2525's user avatar
0 votes
1 answer
796 views

How to plot Django data on a Chart.js graph?

I am so tilted, so so so tilted. Been trying to work chart.js for a while now on my website I built with Django. I want to plot two fields: Dates and Scores. Dates is a date such as 1/6/2022, score is ...
Max Smith's user avatar
0 votes
1 answer
142 views

Building chart using charjs in Django

I need to create a chart with chartjs with displaying month wise count on current year in a line chart. The data should be retrieved from the model named "invoice" and the feild name is &...
TS Tamarai Selvan's user avatar
-1 votes
1 answer
1k views

How to set action on slice-click Doughnut in Chart.js

I've been trying to add chart.js to my Django Project, which worked pretty fine so far. I made a doughnut-chart with two slices. Now i want to have each of those slices to have seperate actions on ...
whoami0605's user avatar
-1 votes
1 answer
49 views

intergrate Chart.js with Django ( data not showing )

im new to django and chart js, and trying to develop some project but I was having some trouble when trying to visualize my data from myAPI into chart JS and it shows nothing, here is my code : var ...
Tasa Fakhri's user avatar
0 votes
1 answer
290 views

Plot Chart.js scatter graph in Django using huge data

I'm developing a scatter graph to visualize the trend of product volume for every product count. x: product count y: product volume From django view, two array list was pass to chart javascript in ...
adi bahadur's user avatar
0 votes
1 answer
147 views

Issue in making a Pie Chart using django with fully dynamic data

I have a Django backend that is sending this dict : {'New': 1, 'Pending': 0, 'Done': 0} I have to make a pie chart with this, So I tried: labels: ["{% for key, value in pie.items %}{{key}}{% ...
Proud Wadhwa's user avatar
1 vote
1 answer
416 views

How to display django models with datetime field in chart using chartjs?

I have a django model which is called ScanBatch. Scan batch is made up of fields like the timestamp (datetime field), domain (char field) and total ids found (integer field). My chart code is : const ...
allen E's user avatar
  • 11
0 votes
1 answer
349 views

Django Time Series with Chart JS

I'm building a Django app that is dynamically feeding data to Chart JS. because I'm trying to join two line series together (historical values and predictions), I'm trying to have Chart JS understand ...
logisticregress's user avatar
0 votes
0 answers
71 views

Updating chart.js with ajax

i'm trying to auto-update my chart js graph trough ajax , but my if statement always return the wrong awnser on the first iter , any idea why ? thank again. , tell me if you need anything more. ...
andy_pi's user avatar
0 votes
1 answer
230 views

How to create chart from a dict?

I have a dict like: print(assigned_incidents) => [ {'name': 'Eda', 'case_type': 'Med'}, {'name': 'Deniz', 'case_type': 'High'}, {'name': 'Alex', 'case_type': 'Med'} {'name': 'Eda', 'case_type':...
edche's user avatar
  • 670
0 votes
1 answer
2k views

How to use Utils from Chartjs on Django

I have a simple Django project that display some charts on a determined page, so when I try to replicate some examples from Chartjs I see that they make use of a Utils module, when I make this same ...
user11717481's user avatar
  • 1,576
1 vote
1 answer
45 views

How to get value of defaultdic in JS (Django framework)?

I want to use chartjs to display a chart on the page (Django framework). views.py chart_data = defaultdict(<class 'int'>, {'3': 2, '2': 2, '8': 2, '5': 2, '7': 1}) context["chart_data"]...
Ada's user avatar
  • 23
2 votes
1 answer
427 views

chartjs-plugin-annotation box in Django app

I have chartjs v2.9.3 in my Django app and it works great. Now I need to add a box to one of my charts using chartjs-plugin-annotation, and I've followed all the steps, but I can't get it to work. I'...
MarkoZg's user avatar
  • 373
1 vote
0 answers
486 views

Add multiple real-time plots on the same page with Chart.js (Django)

i'm trying to add multiple real-time plots on the same page (Django framework) with Chart.js using websockets. When i try to add separate socket on the 2nd plot, the 1st freezes. Here is my code, ...
Fotini K.'s user avatar
0 votes
1 answer
826 views

Chart js multiple pie chart on one page

Iam building my portfolio website and i build a simple stocktracker. I added some charts from Chart.js, but somehow only one gets rendered when I excecute the code. I managed to assign all the divs ...
R. Sp.'s user avatar
  • 13
0 votes
1 answer
802 views

How to filter and add multiple datasets using Django and Chart.js

I've been scratching my head for quite a while on this so any help is much appreciated. Let's say I have a model called Transaction. class Transaction(models.Model): time = models.DateTimeField(...
GabiP's user avatar
  • 1
1 vote
0 answers
48 views

Adding a date selector for a JavaScript chart in HTML

My chart data is based on a list of dictionaries. It's a Django project, so my data is defined in views.py: I count the number of records with Mike, Jane and Jack. mylist= [{'Date': '2021-10-02', 'ID':...
Mary's user avatar
  • 259
0 votes
0 answers
141 views

Create a JavaScript chart in HTML with a date selector

My chart data is based on a list of dictionaries. It's a Django project, so my data is defined in views.py: I count the number of records with Mike, Jane and Jack. mylist= [{'Date': '2021-10-02', 'ID':...
Mary's user avatar
  • 259
0 votes
1 answer
1k views

Add dynamic data in a demo chart.js file of a django template

I'm using the "start bootstrap4" template for my Django project. I want to edit my own data in the sample chart. I need to change it in the chart-pie-demo.js file I already created the list ...
Mary's user avatar
  • 259
0 votes
0 answers
59 views

how to pause setInterval and resume if there is new data from database?

How to pause setInterval if all data from the database are loaded and resumes if there is new data from the database without manual page refresh? The problem with this if I will not use clearinterval()...
Jack Junior's user avatar
0 votes
1 answer
441 views

How do I import Chart.js Helper Functions in Django?

I am using chart.js with django and am receiving an error because I have not imported the chart.js helper functions getRelativePosition and getValueForPixel initialize:178 Uncaught TypeError: Cannot ...
Tyler Dejong's user avatar
0 votes
1 answer
261 views

Changing the opacity of the colour on the Polar Area chart

I am using Chart.js to create a set of polar area charts, I want to change teh opacity of the colour used to display the data so it is slightly transparent. Below you will find the code: var totals = {...
mills's user avatar
  • 23
1 vote
1 answer
1k views

How do I remove the ticks or inner circles of my polar area chart Chart.js

I have written the code for my chart in Jquery and I am using the chart to display data on my Django Web Page, I want to remove the inner circles which I think are called ticks along with the small ...
mills's user avatar
  • 23
0 votes
1 answer
114 views

unable to pass data from views to js file having chart js codes, shows unexpected syntax error

I am trying to make analytics for my webapp, where it whould show data from db graphically. I am using chart js for this. I am learning how to do it from youtube. Strangely they are not getting any ...
Ritankar Bhattacharjee's user avatar
-1 votes
1 answer
245 views

Chartjs is not showing charts in my Django project

I am trying to visualize data in my Django project using Chartjs. right now I'm only concerned with the visualize part and not the backend stuff but for some strange reason the charts refuses to ...
Houston Khanyile's user avatar
0 votes
1 answer
75 views

How to Sum values from different objects in Django?

I want to calculate the workout volume of each user, and then append it so I can use the value in chart.js. This is calculated by multiplying the reps, series, and weight of all exercises in all ...
overclock's user avatar
  • 625
0 votes
0 answers
188 views

django horizontal stacked bar chart

I hope you're all doing great. I have been struggling to make a stacked horizontal bar chart here, I feel like I am not far off from the solution but I can't seem to find it. Bar Chart code: var ctx = ...
Wissam's user avatar
  • 1
-1 votes
1 answer
74 views

Charts not being displayed in django app when using Chart.js 3.6 version

I have a Django application which has charts. They were implement in Chart.js 2.9 version. When I upgraded to Chart.js 3.6 version, I am unable to view the charts. I have check those charts in a ...
SonOfJen NotSoGreat's user avatar
0 votes
1 answer
188 views

Display Charts based on year select in django

I am using django=3.0.0 as my backend. I have years in my database as a datetimefield and I want to put it as an option for my select button which will change the charts dynamically in chartjs. Do I ...
Syed Muhammad Umer's user avatar
1 vote
1 answer
39 views

Django ValueError The view todo_lists.views.visualisation didn't return an HttpResponse object. It returned None instead

everyone. I have views.py here, I want to calculate different status' tasks and output to chart.js pie-chart. I have tried many ways but none of them works. I have an error saying my views def didn't ...
Lucas R.G's user avatar
0 votes
1 answer
91 views

Unable to see the lines in chart.js

I am trying to make a django website which will display a chart that is updated every 1sec. I dont know why but except for the lines everything else is getting update a snapshot of the graph with the ...
Peter Johnson's user avatar
0 votes
1 answer
661 views

How to show data from views on chartjs in django?

I am making an app on Django at the moment and I don't know how to get the data from views to the chart properly. Here's my code for views: def data(request): nysestuff = nyse.objects.all() ...
hello's user avatar
  • 37
0 votes
1 answer
240 views

Remove Decimal like " [Decimal('1220'), Decimal('160')] "from Django Queryset results

I have a queryset result which I would like to put into a list of Data and a list of Labels for Chart.js without showing Decimal. In my view.py the following funtion based view is written: labels = [] ...
Neat1's user avatar
  • 61

1
2 3 4 5