Answer the question
In order to leave comments, you need to log in
Live chart update?
Hello everyone, how to make it in django so that when it is added to the database, it is immediately added to the chart.
Now the graph is like this
cur.execute('SELECT volt FROM Robot')
mas_volt = cur.fetchall()
cur.execute('SELECT amper FROM Robot')
mas_amper = cur.fetchall()
cur.execute('SELECT time FROM Robot')
mas_time = cur.fetchall()
l = []
for time in mas_time:
for ti in time:
t = int(ti)/1000
l.append( '{ x:'+str(t) )
i=0
for amper in mas_amper:
for amp in amper:
l[i] += ',y:' + str(amp) + '},'
i+=1
conn.close()
global mylistwr
mylistwr.mylist=l
return render_to_response('index.html',{'list':l,'mass':mas_volt})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question