SamAmco / track-and-graph

An android app for tracking personal data and creating custom graphs
GNU General Public License v3.0
436 stars 40 forks source link

Plot only points with data #209

Open KonTy opened 1 year ago

KonTy commented 1 year ago

Right now T&G plots graphs based on time periods. It would be nice to have an option to skip time periods when there is no data.

Let's say I log my weight irregularly sometimes once aweek, some other time every day, other times once every 3 months. The point is irregularly. Right now, T&G will pick time periods and plot a graph during those time periods even if we don't have a data point. As a result the line looks jagged and very hard to read. See picute below: How it is marked

If we had an ability to only plot point which have data and divide graph to equal points that do exist it would look something like this:

proper

In most cases I think this is prefered behavior, because this is the default behavior in all plotting solutions that I've used (ex Excel, PowerBI etc)

SamAmco commented 1 year ago

Hi @KonTy I'm sorry but I disagree that this is a good standard behaviour. Looking at the graphs you posted, this graph is perfectly readable:

image

I personally find it quite confusing because the X-Axis seems to imply that there is a gap of almost a year between the second two points but a gap of only a few days between the first two points. Yet geometrically it's as though the two are equidistant. Still I think it's subjective.

The last graph is much less clear:

image

There are three points there that don't have a date under them, and the erratic nature of the X-axis does not help you infer the dates intuitively. Perhaps this app has a function where tapping the point will tell you the date. That's all very well but many people using track & graph (my self included) have graphs with hundreds, maybe thousands, of points on them. You rely on the X-axis to gain a sense of the relationship between your data and the passing of time.

Say for example I track exercise, and for a whole year i exercise every single day, but then i take a full month off before exercising again. If the graph behaved the way you are suggesting you wouldn't see that gap at all as the distance of one month between exercising would be squashed to the same scale as the day taken between every other time.

If this feature were to be implemented you might as well remove the X-axis labels almost entirely as they are mostly misleading, perhaps you would just have a start and end label. Still I haven't seen a lot of demand for this and I don't really understand the use case so I am unlikely to implement this.

KonTy commented 1 year ago

Hey Sam, thank you for such a detailed response. I guess I didn't make my self clear enough. I was not asking to change the default behavior of the current graphs. The type of graph the I describe above is a well known graph type in statistics called "Trend graph" besically you use it when you want to see where you are trending up of down regardless of individual time plots. For example, you go to a doctor and take a physical, you discover that you have high blood sugar, so you log it then you do it again in a month, them after 6 months and do you less and less often. All you want to see if you are on the right trajectory. If you try to plot it now it will all be jagged and not look nice. but if you only show points that exist it will be a nice trend line. There are plenty of uses for this type of graph.

Sorry I was asking for a new type of graph, or maybe a check box that would say something like: " Do not plot empty time periods" not to change the behavior of all current graphs.

KonTy commented 10 months ago

Hi @SamAmco is there a way I can Sponsor and Donate for you to develop this functionality? I'm not asking for this to be a default behavior, instead if it was a type of line chart. That way whoever needs it can chose "Trend line chart" from the drop drop down which will have this behavior. This type of graph is very useful when you are plotting trends and then the data is not logged consistently

SamAmco commented 10 months ago

Hi @KonTy. Sorry I can not find time for this. Between my job and my newborn I have no time for this project these days. I will try and fix critical bugs but features like this are just not on my radar for the foreseeable future. My only suggestion is to fork the repository and have a go yourself. Unless of course you want to pay me enough to quit my job :stuck_out_tongue: