brunobeeee / drinklog

A habit tracker for tracking water intake.
0 stars 0 forks source link

Add arrow buttons to scroll through the plot intervals #67

Closed brunobeeee closed 2 months ago

brunobeeee commented 6 months ago

Since #66 can set the plot interval to week, month, year and all. When selecting month for example you can only see the current month. Same with the others. It would be nice to have arrow buttons to "scroll" through the data using the selected interval. If you press < then you get to the last month. If you press > you can see the next one.

For this it would be good to pass another parameter to the URL that specifies which week, month or year should be shown. Show the current month:

.../log-plot/?section=month&index=0

Show the next year:

.../log-plot/?section=year&index=1

Show the last week:

.../log-plot/?section=week&index=-1
brunobeeee commented 2 months ago

After #72 my ideas to control this feature with URL parameters are obsolete. Don't do it!

Instead use JS code and PlotlyJS's relayout() function to control the timeframe. Also it should be displayed what timeframe is shown: