dangermccann / logseq-metrics

MIT License
36 stars 4 forks source link

[Feature request] Bar chart for journal properties #16

Closed redstreet closed 5 months ago

redstreet commented 1 year ago

Wondering if it would be hard to include a properties-bar like the existing properties-line? Thanks for considering!

dangermccann commented 1 year ago

Sounds doable. Let me have a look.

dangermccann commented 1 year ago

Question about this: are you interested in using a bar chart for time series data where, for example, the month appears on the x-axis and the sum of the data points is plotted on the y-axis? Or is this more for showing cumulative data, such as total miles run?

redstreet commented 1 year ago

I'm personally interested in the former.

I'm interested in plotting individual, average, and sums of daily, time series data.

One additional note: would it be possible to default to zero for days where the property is missing?

Thank you!

dangermccann commented 1 year ago

Alright, so I'm thinking that it can have two ranges for the x-axis: daily or monthly. For daily it would plot entries for the past N days, and sum up the data for each day. In monthly mode it would plot entries for the past N months and display either the total or daily average for that month. Does that sound like what you're looking for?

redstreet commented 1 year ago

I was thinking of it slightly differently:

  1. At a basic level, I was thinking of simply being able to select a bar chart as an option to replace the current line chart, which works much better for non continuous data. In addition, the ability to assume default value of 0 for days on which a value is not available.

  2. To add to this, a chart (bar and line would both be options) to plot the average, grouped over N days. This generalizes it. More specifically:

plot_aggregate(metric, "average/sum", start-date, time_period(N))

Here is an example: say I want to analyze how many minutes of running I do per day, which I log daily in my journal. I might be interested in:

plot_aggregate(running_minutes, average, 2022-11-01, 7)

Does that seem reasonable and useful? Happy to engage more on this if needed.

Saidelocha commented 1 year ago

I join this feature request. I will use it to know which sport I look more, or which type of movie. But without the friction to open the panel and add data to the page plugin-metric-data. Like this I can have template already made and just change the data inside.

dangermccann commented 5 months ago

Implemented in version 0.22. Let me know what you think!