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

Display statistics as a graph #136

Closed
Natim opened this issue Feb 3, 2016 · 26 comments
Closed

Display statistics as a graph #136

Natim opened this issue Feb 3, 2016 · 26 comments
Labels
feature request UI/UX User Interface / User Experience

Comments

@Natim
Copy link
Member

Natim commented Feb 3, 2016

It could be nice to have a summary tab with information about what everybody did pay and did spend as well as the total of expenses for the group.

@almet
Copy link
Member

almet commented Feb 3, 2016

What would that look like?

@Natim
Copy link
Member Author

Natim commented Feb 5, 2016

solde-demo

I was thinking of something like that.

@almet
Copy link
Member

almet commented Feb 6, 2016

That's really cool! I think we could even provide this information as a graph (Diverging stacked bar chart)

@almet almet mentioned this issue Feb 1, 2017
@0livd 0livd changed the title A new Summary tab Display statistics as a graph Dec 26, 2017
@zorun
Copy link
Collaborator

zorun commented Mar 15, 2018

Having a graph for statistics would be very nice, and probably not that hard to do, I can give it a try :)

I think this kind of simple line chart would be easier to read: http://www.chartjs.org/samples/latest/charts/line/basic.html
There would be one line for each participant, and one point per month showing the balance for the month. There could be an option to show the cumulative balance instead of the "instantaneous" balance. The timescale could be changed by the user to display data by day, or week, or year.

One practical question though: would it be better to use the API with Ajax queries, or just write a view that generates the necessary data?
Generating javascript variables in a Jinja template (like here) is simple but not very clean, while Ajax queries are cleaner but involve dealing with API authentication.

@Natim
Copy link
Member Author

Natim commented Mar 16, 2018

@zorun thank you for your message and welcome to this project.

I don't think the project already have a REST API, so if you were to build one, it would be a bit of work. (CORS, Auth, utilities, documentation).

Also it might be a interesting project to build one.

For now, I guess having a django rendered view would be good enough.
I also wish to have a table explaining how much money users spend.

I am usually using a project per trip (with family and friends) and I don't need the monthly feature but more a total of all the expenses.

Last time I also wanted some metrics about how much was spend for the car, how much for the accomodation and how much for food and tourism.

@zorun
Copy link
Collaborator

zorun commented Mar 16, 2018

Hi @Natim

There are already such statistics shown in a table, from #257 :) see for instance https://ihatemoney.org/demo/statistics

Regarding the API, I was thinking of using this one https://ihatemoney.readthedocs.io/en/latest/api.html

@almet
Copy link
Member

almet commented Aug 5, 2018

@zorun we never actually answered you! I think the best way to go is to integrate the Javascript in a view to be served directly by the python app. While this method is subject to discussion, it's the way all the project is currently built, so we better stick with it for clarity :-)

If you want to work on this (or if anyone wants), don't hesitate, that would be a welcome addition! Cheers!

@indatwood
Copy link
Contributor

It seems this feature is still looking for somebody to implement it :-)

@zorun
Copy link
Collaborator

zorun commented Apr 23, 2020

Yes, I never went around to try something, feel free to pick this up :)

For now I'm producing graphs "offline" with a custom json-to-gnuplot conversion script, but it would definitely be better to have it integrated in IHM!

@CubixPro
Copy link

Can I work on this?

@Glandos
Copy link
Member

Glandos commented May 21, 2020

@CubixPro yes, you can start working on this.
Don't hesitate to make a prototype first. We usually prefer solutions that are lightweight: not too much dependencies, and keep the page light on JS for example.
I know that nice charting needs JavaScript. But we don't need to provide a Grafana-like screen :)

@CubixPro
Copy link

CubixPro commented May 21, 2020

Should I use Canvasjs.js or google charts? And where can I send the prototypes?

@Glandos
Copy link
Member

Glandos commented May 24, 2020

It seems that CanvasJS requires a licence. Google Charts requires loading from Google servers, so it's also a non-goal for this project.

However, there are a lot (too much?) other libraries that can fit. For example C3.js that is based on D3. It's maybe missing some features but I don't think we need them. Or, if you find a missing use case, please tell us :)

For prototypes, you can simply start but sending screenshot in this thread. You can drag'n'drop images right in the comment text field, and GitHub will upload it for you.

@CubixPro
Copy link

Okay sure thanks. I'll look into this and let you know :)

@thejacobx
Copy link

Hi guys, is this still open? Can I work on this issue? :)

@Glandos
Copy link
Member

Glandos commented Nov 24, 2020

I can't believe I waited so long to answer to you, @thejacobx. If you are still opened to contribution, you can start on it.
But be aware that we will accept a contribution with a compatible charting library. So, no external loading, a no non-free license :)

@mcflyhalf
Copy link

I am hoping that the 3rd time would be a charm with this issue and checking whether it is still available. I am willing to take it up.
Is this still open? Can I try to work on it?

@chovo-55
Copy link

chovo-55 commented Oct 7, 2021

Hi, I would like to work on this issue, is it stil available?

@CarlosPimentel10
Copy link

Hello I will work on this!

@almet
Copy link
Member

almet commented Oct 20, 2021 via email

@CarlosPimentel10
Copy link

CarlosPimentel10 commented Oct 20, 2021 via email

@almet
Copy link
Member

almet commented Oct 20, 2021

Please, have a look at the existing PR at #731. good stuff there, it was abandoned but you probably could build on top of it.

@CarlosPimentel10
Copy link

CarlosPimentel10 commented Oct 21, 2021 via email

@CarlosPimentel10
Copy link

CarlosPimentel10 commented Nov 26, 2021 via email

@almet
Copy link
Member

almet commented Nov 28, 2021

Hey, cool to have you onboard :-) I can try helping you the best I can. Can you please post some information so I can try debug the situation? You could for instance put the error message here, and maybe a stacktrace?

Also, the best way to do this would be to open a new issue to help you getting started, in order to keep the history of this issue clear! Cheers.

@zorun zorun added UI/UX User Interface / User Experience and removed good first issue labels Dec 14, 2023
@zorun
Copy link
Collaborator

zorun commented Apr 27, 2024

A statistics page (as requested initially) has been added a long time ago.

There have been several attempts at adding graphs but none went through. Ihatemoney is currently very lightweight regarding javascript (I believe we only have javascript from bootstrap), and this is something we want to keep, see https://ihatemoney.readthedocs.io/en/latest/contributing.html#current-direction-as-of-2024

As mentioned by @Glandos in #1011, one way to go would be to use pygal and its Flask integration.

I am closing this ticket because it is not a priority of the project, but a simple proposal using pygal and good UI/UX integration would definitely be considered for inclusion.

@zorun zorun closed this as not planned Won't fix, can't repro, duplicate, stale Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request UI/UX User Interface / User Experience
Projects
None yet
Development

No branches or pull requests

10 participants