How to add graphics to your Spark program
In this recipe, we discuss how to use JFreeChart to add a graphic chart to your Spark 2.0.0 program.
How to do it...
- Set up the JFreeChart library. JFreeChart JARs can be downloaded from the https://sourceforge.net/projects/jfreechart/files/ site.
Â
- The JFreeChart version we have covered in this book is JFreeChart 1.0.19, as can be seen in the following screenshot. It can be downloaded from the https://sourceforge.net/projects/jfreechart/files/1.%20JFreeChart/1.0.19/jfreechart-1.0.19.zip/download site:
- Once the ZIP file is downloaded, extract it. We extracted the ZIP file under
C:\
for a Windows machine, then proceed to find thelib
directory under the extracted destination directory. - We then find the two libraries we need (JFreeChart requires JCommon),
JFreeChart-1.0.19.jar
andJCommon-1.0.23
:
- Now we copy the two previously mentioned JARs into the
C:\spark-2.0.0-bin-hadoop2.7\examples\jars\
directory.
Â
- This directory, as mentioned in the previous setup...