The analysis of JSON files in the shell is already familiar to me, jq is a reliable tool that can also be installed from the package manager of Debian. The JSON file contains today’s date with current data and 8-day forecast starting from today’s date. What is closer than storing the forecast data in arrays for processing? But Does the bash know array variables? Yes, the bash knows. This should simplify data processing.
An unexpected help was W3Schools! Here I could find design elements, call examples and edit them, and learn how to use them - fantastic! With this support, I was able to easily implement my ideas. The basis for this quick implementation is the sophisticated CSS file that finds usage for W3Schools CSS elements and thus greatly simplifies complex CSS. Of course, I make myself this file locally available:
sudo wget "https://www.w3schools.com/w3css/4/w3.css" -o /var/www/html/w3.css
Gnuplot generates the temperature curve
When I discovered GnuPlot, the way to the temperature curve was revealed. You can work interactively or specify an input file to automate. Perfect match. Crucial help was this hint from this answer, on how I get triangles with different side lengths.
To achieve this, I used the highest and lowest points of the current day for the left side of the rectangle and the next day’s points for the right side. Gnuplot automatically connects the upper and lower sides of the triangle for the next day. The square for the next day simply uses the right-side points of the previous rectangle as its own left side, and so on. The distance between the points on the x-axis is arbitrary chosen and Gnuplot is also instructed to stretch the graph to achieve the desired result.