With the changes in reports mentioned previously, I thought that I would be able to start adding SVG graphics to reports since I was using the same object to display the report as I had previously used for printing roast profiles. Due to the content getting to that object through a slightly different code path, it turned out that I needed to add 25 characters to the new code to turn that feature on.
The difference is specifying an application/xhtml+xml MIME type for the data. Without this, the SVG content is simply ignored. With this change and a bit of algebra, it’s possible to construct graphical representations of any quantitative data that can be gathered from the database. The top image shows a graph with four data series showing cumulative roasted coffee production for every day of the year to date, the same data for the previous year, the percent change, and a seven day rolling average of the percent change. Note that the axis ticks and labels are not hard coded, but are selected based on the data being plotted.