Class VectorGraphicsEncoder
java.lang.Object
org.knowm.xchart.VectorGraphicsEncoder
A helper class with static methods for saving Charts as vectors
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classstatic enum -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateConstructor - Private constructor to prevent instantiation -
Method Summary
Modifier and TypeMethodDescriptionstatic 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(Chart chart, OutputStream os, VectorGraphicsEncoder.VectorGraphicsFormat vectorGraphicsFormat) Write a chart to an OutputStream.static voidsaveVectorGraphic(Chart chart, String fileName, VectorGraphicsEncoder.VectorGraphicsFormat vectorGraphicsFormat) Write a chart to a file.
-
Constructor Details
-
VectorGraphicsEncoder
private VectorGraphicsEncoder()Constructor - Private constructor to prevent instantiation
-
-
Method Details
-
saveVectorGraphic
public static void saveVectorGraphic(Chart chart, String fileName, VectorGraphicsEncoder.VectorGraphicsFormat vectorGraphicsFormat) throws IOException Write a chart to a file.- Throws:
IOException
-
saveVectorGraphic
public static void saveVectorGraphic(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
-