Package org.knowm.xchart
Class VectorGraphicsEncoder
java.lang.Object
org.knowm.xchart.VectorGraphicsEncoder
A helper class with static methods for saving Charts as vectors
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.static void
saveVectorGraphic
(org.knowm.xchart.internal.chartpart.Chart chart, OutputStream os, VectorGraphicsEncoder.VectorGraphicsFormat vectorGraphicsFormat) Write a chart to an OutputStream.static void
saveVectorGraphic
(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 IOException Write 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 IOException Write 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
-