Package org.knowm.xchart
Class VectorGraphicsEncoder
java.lang.Object
org.knowm.xchart.VectorGraphicsEncoder
public final class VectorGraphicsEncoder extends Object
A helper class with static methods for saving Charts as vectors
- Author:
- timmolter
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVectorGraphicsEncoder.VectorGraphicsFormat -
Method Summary
Modifier and Type Method Description static StringaddFileExtension(String fileName, VectorGraphicsEncoder.VectorGraphicsFormat vectorGraphicsFormat)Only adds the extension of the VectorGraphicsFormat to the filename if the filename doesn't already have it.static voidsaveVectorGraphic(org.knowm.xchart.internal.chartpart.Chart chart, OutputStream os, VectorGraphicsEncoder.VectorGraphicsFormat vectorGraphicsFormat)Write a chart to an OutputStream.static voidsaveVectorGraphic(org.knowm.xchart.internal.chartpart.Chart chart, String fileName, VectorGraphicsEncoder.VectorGraphicsFormat vectorGraphicsFormat)Write a chart to a file.
-
Method Details
-
saveVectorGraphic
public static void saveVectorGraphic(org.knowm.xchart.internal.chartpart.Chart chart, String fileName, VectorGraphicsEncoder.VectorGraphicsFormat vectorGraphicsFormat) throws IOExceptionWrite a chart to a file.- Throws:
IOException
-
saveVectorGraphic
public static void saveVectorGraphic(org.knowm.xchart.internal.chartpart.Chart chart, OutputStream os, VectorGraphicsEncoder.VectorGraphicsFormat vectorGraphicsFormat) throws IOExceptionWrite a chart to an OutputStream.- Throws:
IOException
-
addFileExtension
public static String addFileExtension(String fileName, VectorGraphicsEncoder.VectorGraphicsFormat vectorGraphicsFormat)Only adds the extension of the VectorGraphicsFormat to the filename if the filename doesn't already have it.- Parameters:
fileName-vectorGraphicsFormat-- Returns:
- filename (if extension already exists), otherwise;: filename + "." + extension
-