heikkilevanto / beertracker

Simple script to track the beers I drink
GNU General Public License v2.0
2 stars 1 forks source link

Scroll annual stats graph #278

Closed heikkilevanto closed 2 months ago

heikkilevanto commented 5 months ago

So that the months always end in the current month. That way even in January the lines will have some continuity.

Tricky to do with the way the plot file is currently generated. The month name and each year value are on the same line, and will be shown in the same color. Now we would need to change the color in the middle of the line.

heikkilevanto commented 2 months ago

Maybe one approach would be to append a random year to the month name, and one higher for the months before the current. That way Gnuplot would sort the columns right. But each line would still have the same color.

Another would be to split the lines, again with month-year indexes, and shift the columns so that the coloring would match.

heikkilevanto commented 2 months ago

Added the year to the lines (2000 or 2001). Seems to work, but there is no continuity from Dec to Jan.

Better collect the lines in an array, and sort them. That way Gnuplot will see a continuous set of values and produce an unbroken line.