Thanks a lot will have a look muratkas...@gmail.com schrieb am Donnerstag, 13. Oktober 2022 um 19:27:16 UTC+7:
> Hi, > > There is a good explanation on these links: > https://www.chartjs.org/docs/latest/developers/updates.html > > https://stackoverflow.com/questions/17354163/dynamically-update-values-of-a-chartjs-chart > > and https://codepen.io/statuswoe/pen/kQMLom > > I think you can call your function with ajax inside from "updateData": > > setInterval(function(){ > *updateData*(data); > myNewChart.Line(data, optionsNoAnimation) > ;}, 2000 > > -- > Murat. > > > Silvian “Top 10 Answers” Cedru <silvia...@gmail.com>, 3 Eki 2022 Pzt, > 06:59 tarihinde şunu yazdı: > >> Hello everyone, >> >> I want to create a dynamic chart using Chart.js with data from the >> database but I am not really sure how to do that . I have manager to create >> predefined and filled arrays but I dont know how to make it dynamic I have >> here my controller code >> >> def calc(): >> >> teams = db(db.projects).select(orderby=db.projects.id) >> rows1 = db(db.projects).select(orderby=db.projects.id) >> rows = db(db.projects).select(orderby=db.projects.id) >> >> # Calculation for total project by Teams in different >> developmentphases >> construct = db(db.projects.project_devlopment_phase).select() >> identification = >> db(db.projects.project_devlopment_phase=='0').select() >> >> pre_feasibility= db(db.projects.project_devlopment_phase=='1' >> ).select() >> feasibility= db(db.projects.project_devlopment_phase=='2' ).select() >> understudy = pre_feasibility + feasibility >> >> financing = db(db.projects.project_devlopment_phase=='3' ).select() >> implementation = db(db.projects.project_devlopment_phase=='4' >> ).select() >> under_construction = financing + implementation >> >> wp = db(db.projects.technology=='WP').select() >> sp= db(db.projects.technology=='SP').select() >> hp = db(db.projects.technology=='HP').select() >> bi = db(db.projects.technology=='BI').select() >> >> re = wp + sp + hp + bi >> >> data2d = [[100, 12, 5, 2, 5], [5, 100, 10,4,1 ], [5, 8, 100, 5,6], >> [12,15,8,6,100]] >> data1d = [11,5, 12,6, 5,100, 2,100] >> >> mylist = list(dict.fromkeys(data1d)) >> >> return dict(mylist=mylist, team=team, datatest=datatest, data2d=data2d >> ,data1d = data1d,construct=construct,rows1= rows1 ,teams=teams, rows=rows, >> identification=identification, understudy=understudy, >> under_construction=under_construction, >> re=re) >> >> -- >> Resources: >> - http://web2py.com >> - http://web2py.com/book (Documentation) >> - http://github.com/web2py/web2py (Source code) >> - https://code.google.com/p/web2py/issues/list (Report Issues) >> --- >> You received this message because you are subscribed to the Google Groups >> "web2py-users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to web2py+un...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/web2py/84192b23-cc7c-4553-ae42-baea1b88b4ben%40googlegroups.com >> >> <https://groups.google.com/d/msgid/web2py/84192b23-cc7c-4553-ae42-baea1b88b4ben%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/097663b3-610a-4186-bc8a-50051ba630fdn%40googlegroups.com.