ihatemoney icon indicating copy to clipboard operation
ihatemoney copied to clipboard

Display statistics as a graph

Open Natim opened this issue 9 years ago • 25 comments

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.

Natim avatar Feb 03 '16 17:02 Natim

What would that look like?

almet avatar Feb 03 '16 17:02 almet

solde-demo

I was thinking of something like that.

Natim avatar Feb 05 '16 17:02 Natim

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

almet avatar Feb 06 '16 12:02 almet

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.

zorun avatar Mar 15 '18 23:03 zorun

@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.

Natim avatar Mar 16 '18 08:03 Natim

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

zorun avatar Mar 16 '18 08:03 zorun

@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!

almet avatar Aug 05 '18 16:08 almet

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

indatwood avatar Apr 22 '20 15:04 indatwood

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!

zorun avatar Apr 23 '20 16:04 zorun

Can I work on this?

CubixPro avatar May 21 '20 07:05 CubixPro

@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 :)

Glandos avatar May 21 '20 09:05 Glandos

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

CubixPro avatar May 21 '20 14:05 CubixPro

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.

Glandos avatar May 24 '20 08:05 Glandos

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

CubixPro avatar May 24 '20 17:05 CubixPro

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

thejacobx avatar Oct 06 '20 11:10 thejacobx

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 :)

Glandos avatar Nov 24 '20 22:11 Glandos

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?

mcflyhalf avatar Mar 09 '21 09:03 mcflyhalf

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

chovo-55 avatar Oct 07 '21 10:10 chovo-55

Hello I will work on this!

CarlosPimentel10 avatar Oct 20 '21 08:10 CarlosPimentel10

Play thanks ! Let us know if you need help ☺️

Le 20 octobre 2021 10:39:04 GMT+02:00, Carlos Pimentel @.***> a écrit :

Hello I will work on this!

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/spiral-project/ihatemoney/issues/136#issuecomment-947451602

almet avatar Oct 20 '21 10:10 almet

Hi Spiral-Project/Ihatemoney,

Thanks for the feedback. I am planning to use a Python Graph Library like Seaborn or GGPlot, both are open source, and I used those quite a lot and would feel comfortable with it.

I would appreciate any further useful guideline you may want to give me.

Thanks and regards, Carlos

On Wed, Oct 20, 2021 at 11:31 AM Alexis Metaireau @.***> wrote:

Play thanks ! Let us know if you need help ☺️

Le 20 octobre 2021 10:39:04 GMT+02:00, Carlos Pimentel @.***> a écrit :

Hello I will work on this!

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub:

https://github.com/spiral-project/ihatemoney/issues/136#issuecomment-947451602

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/spiral-project/ihatemoney/issues/136#issuecomment-947537421, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMXPHE653MLKOGRQOR33CU3UH2K65ANCNFSM4B2KSYUA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

CarlosPimentel10 avatar Oct 20 '21 21:10 CarlosPimentel10

Please, have a look at the existing PR at https://github.com/spiral-project/ihatemoney/pull/731. good stuff there, it was abandoned but you probably could build on top of it.

almet avatar Oct 20 '21 21:10 almet

Hello Alexis.

Thanks for the tip, I have looked and it became more clear to me.

Kind regards, Carlos

On Wed, Oct 20, 2021 at 10:50 PM Alexis Metaireau @.***> wrote:

Please, have a look at the existing PR at #731 https://github.com/spiral-project/ihatemoney/pull/731. good stuff there, it was abandoned but you probably could build on top of it.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/spiral-project/ihatemoney/issues/136#issuecomment-948063810, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMXPHE3SUNN2AIO6GYDELMLUH42SXANCNFSM4B2KSYUA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

CarlosPimentel10 avatar Oct 21 '21 17:10 CarlosPimentel10

Hello Guys.

Sorry for not giving any feedback yet.

I was pretty tight on time working on 2 startup projects plus Google MWS track and a mobile internship. I am pretty much done with both study projects so I was trying to tackle the #736 graph stats issue.

I am not quite familiar with flask, so I forked the repo, cloned it and installed missing flask dependencies however I can't launch the app. I know is probably something very simple, the thing is I am good with ML and Statistics with scikit, and so on but I want to see first how the api is working right now then I can, make the additions in the models.py or other files.

I am keen to tackle this one and keep learning

On Thu, Oct 21, 2021 at 6:03 PM Carlos Pimentel_leanTech < @.***> wrote:

Hello Alexis.

Thanks for the tip, I have looked and it became more clear to me.

Kind regards, Carlos

On Wed, Oct 20, 2021 at 10:50 PM Alexis Metaireau < @.***> wrote:

Please, have a look at the existing PR at #731 https://github.com/spiral-project/ihatemoney/pull/731. good stuff there, it was abandoned but you probably could build on top of it.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/spiral-project/ihatemoney/issues/136#issuecomment-948063810, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMXPHE3SUNN2AIO6GYDELMLUH42SXANCNFSM4B2KSYUA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

CarlosPimentel10 avatar Nov 26 '21 18:11 CarlosPimentel10

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.

almet avatar Nov 28 '21 22:11 almet

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 avatar Apr 27 '24 13:04 zorun