dangermccann / logseq-metrics

MIT License
36 stars 4 forks source link

[Feature Request] Use query and block-properties to render the chart. #4

Closed WsinGithub closed 2 years ago

WsinGithub commented 2 years ago

Hi! Thank you for this amazing plugin!

I am wondering if it is possible to render the chart using data from query?

To be more specific, I have those block in journal:

[[2022/11/18]]
- #Health
weight:: 80
diet:: 2000

[[2022/11/19]]
- #Health
weight:: 79
diet:: 2300

[[2022/11/20]]
- #Health
weight:: 81
diet:: 1900

And I want to draw the chart using data from block with #Health like this: image

dangermccann commented 2 years ago

Good suggestion. I'll try to add this.

dangermccann commented 2 years ago

I added this feature into 0.10. Please update to the latest version and try it out. Details on the readme.

redstreet commented 1 year ago

Nicely done. This is exactly what I came here to ask. Thanks for this feature, and for this great plugin overall! It does everything that is needed (including plotting multiple values), is simple to use, looks nice, and behaves exactly as expected :).

redstreet commented 1 year ago

BTW, this feature wasn't clear to me from the README.md. Perhaps mentioning something like this might help:

There are two ways to provide the data that this plugin needs to display graphs. One is the built-in "Metrics Add" command, which captures and writes your data into the metrics-plugin-data page. The other way is to simply store your own data as Journal properties. Simply add weight:: 20 to the first bullet of any Journal page, and this plugin can find and plot those values.

redstreet commented 1 year ago

@dangermccann happy to submit a PR for the README if you prefer.