A little bonus for this new feature
Being able to choose the aggregation function is nice… but it’s not enough!
I think it’s essential to also be able to group values by time interval : by hour, by day, by week, by month, or even by year.
That’s why I’m offering a new option in the charts to enable this time-based grouping:
Since editing the widget was getting a bit long for charts, I also added a button to hide advanced options by default . The user can then expand them only if they need to:
With this development, we cover all use cases :
Sum of values per day (group by day + « sum » function)
Count the number of values sent by a sensor per week
Average temperature per month
And much more…
In short: everything is now possible!
The PR:
master ← chart-add-grouping
ouvert 08:05AM - 10 May 25 UTC
### Pull Request check-list
To ensure your Pull Request can be accepted as fa… st as possible, make sure to review and check all of these items:
- [x] If your changes affects code, did your write the tests?
- [x] Are tests passing? (`npm test` on both front/server)
- [x] Is the linter passing? (`npm run eslint` on both front/server)
- [x] Did you run prettier? (`npm run prettier` on both front/server)
- [x] If you are adding a new features/services, did you run integration comparator? (`npm run compare-translations` on front)
- [x] Did you test this pull request in real life? With real devices? If this development is a big feature or a new service, we recommend that you provide a Docker image to the community ([french forum](https://community.gladysassistant.com/)/[english forum](https://en-community.gladysassistant.com/)) for testing before merging.
### Description of change
Add group by in charts
https://community.gladysassistant.com/t/graphiques-afficher-cumul-valeur-par-jours-semaine-mois-annee/7106/10
https://community.gladysassistant.com/t/pouvoir-afficher-les-graphiques-en-max-ou-en-somme/7682/5?u=pierre-gilles
4 Likes