Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

How to Implement Chartist.js in Django?

I have no fucking idea how to go about adding charts that pull information from my database onto a web page. Do I need a different view for each chart? Do I have to add js stuff? If anyone has helpful resources that arent Pretty Printed on Youtube or official documentation please let me know. I've tried those resources but couldn't figure it out. If anyone has experience with Chartist or is really good with Django I'd be thrilled to have you help me out with this as it's driving me insane.
Edit: Im so lost right now I don't even have code that I need debugging help with I straight up don't know how to do this.
[Image: hfnmhEI.jpg]
With most .js libraries you implement it the same way you would normally -- or, in other words, the same way as if the website was just a simple HTML/CSS/JS. Then you pass the data via Django's context.

views.py



test.html



I assume you know how to setup urls.py and how Django works in itself. The above will output the following:

[Image: YLNm4ga.png]

Hopefully this helps.
(Dec 9, 2020 11:55 AM)synchronizing Wrote:  With most .js libraries you implement it the same way you would normally -- or, in other words, the same way as if the website was just a simple HTML/CSS/JS. Then you pass the data via Django's context.

views.py



test.html



I assume you know how to setup urls.py and how Django works in itself. The above will output the following:

[Image: YLNm4ga.png]

Hopefully this helps.

thank you so much Im going to try to implement it in a little bit, really appreciate the sample code. I've got a pretty good grasp on django so hopefully I can figure it out!
[Image: hfnmhEI.jpg]
(Dec 9, 2020 11:58 AM)Sмℯґƒ Wrote:  thank you so much Im going to try to implement it in a little bit, really appreciate the sample code. I've got a pretty good grasp on django so hopefully I can figure it out!

My pleasure. Good luck!
So did you ever get it to work or what?
(Jul 12, 2023 04:49 AM)-Scrub Wrote:  i fucked my friend in the ass while he sucked off his friend and then switched and then my friend fucked his friend in the ass and i fucked my friends friend in the ass and we all cummed on my friends friend..
(Dec 9, 2020 09:05 PM)Lrrr Wrote:  So did you ever get it to work or what?

OP PMd me and said he got it to work. :)
(Dec 10, 2020 09:41 AM)synchronizing Wrote:  OP PMd me and said he got it to work. :)

This haha sorry, forgot to update the thread because of that
[Image: hfnmhEI.jpg]


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by NavTechSep 13, 2022 07:23 AM 9 291 Sep 13, 2022 07:23 AM
Last Post: еlixir
[C] by yuumiJun 5, 2022 06:30 PM 22 553 Jun 5, 2022 06:30 PM
Last Post: yuumi
[C#] by fallagFeb 13, 2021 10:44 PM 9 398 Feb 13, 2021 10:44 PM
Last Post: uint32