Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate Charts from Views? #50

Closed
cosbgn opened this issue Mar 30, 2017 · 4 comments
Closed

Generate Charts from Views? #50

cosbgn opened this issue Mar 30, 2017 · 4 comments

Comments

@cosbgn
Copy link

cosbgn commented Mar 30, 2017

I'm going through the documentation but I'm a bit confused on one thing. On all the examples charts are generated from data on models.

I'm using an API (in my views.py) to retrieve data and I would like to generate charts on the fly without the need to save this data to my db. Is this possible? Any example that uses data from the views?

Thanks

@atodorov
Copy link
Contributor

@cosbgn can you be more descriptive. How do you store the data inside the view? Is it in a list or something else? If possible give me an example, can be pseudo-code.

@cosbgn
Copy link
Author

cosbgn commented Mar 30, 2017

Hi @atodorov thanks for the quick response. So for example one chart I would like to have is a simple line chart with sessions (Y-axis) and date (X-axis). The API gives me data back in this format: https://gist.github.com/Cosbgn/526f5fd7150c4065b9fa4e54909ebb78

My first approach is to have several functions in my views.py file that get the data and then return the template loading multiple charts, but maybe I'm doing things wrong. Should I save this in my db? I wanted to avoid that because I'm dealing with a lot of data for each user and I might overcomplicate things. Thanks

@cosbgn
Copy link
Author

cosbgn commented Mar 30, 2017

I concluded that the best way is to save data in my db and use that to load charts. Thanks.

@atodorov
Copy link
Contributor

Duplicate of #21. Not possible at the moment. I've been planning to work on it for quite a while but haven't managed to find the time. Feel free to open a PR or pm me if you'd like this to happen sooner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants