A developer that uses JFreeChart asked me how they should go about using it with data from a CSV file (that is, a text file containing a table of comma-separated values). There are many different approaches that could be taken, so here I will give one example that makes use of the OpenCSV project. We are going to create a chart showing excess death statistics by country during the COVID19 crisis (the source of the data is https://ourworldindata.org/excess-mortality-covid). The end result looks like this:
I’m maintaining a number of open source Java libraries on Github. I have created modular versions for all of them, except JFreeChart (which will take some more time). Here is a summary of the latest version numbers, with the non-modular versions in the JDK8+ column and the modular versions in the JDK11+ column.
Today I downloaded the latest Eclipse (Oxygen 3A) release because a customer is asking about getting started with JFreeChart and Eclipse, and the existing instructions for that are a bit out of date. Here are some new instructions for getting started.
I created OrsonPDF a few years ago because I wanted a lightweight API for exporting charts (JFreeChart and Orson Charts) to PDF files. The approach used is to implement the
Graphics2D API (from Java2D), and under the hood write the code that generates the corresponding PDF bytes. This works really well, and the resulting jar file is around 67kb, which I would classify as lightweight.
In the last week I continued my efforts to streamline my open source libraries, and released a new version of Orson Charts (a 3D chart library for the Java platform). I moved the JavaFX support into a separate project Orson Charts FX, transferred the demo code into separate projects and removed Ant build support (leaving just the Maven-based builds).
Yesterday I released new versions of JFreeChart (a 2D chart library for Java), JFreeChart-FX (JavaFX extensions for JFreeChart) and FXGraphics2D (a utility library that allows Java2D code to draw to a JavaFX Canvas). These are the first updates I’ve done in a long while. I have reduced time these days to devote to open source work, so I’ve put some focus into streamlining the build and release procedures that I’m using, with the aim that I will be able to do smaller and (hopefully) more frequent releases in the future.