Class VectorGraphicsEncoder


  • public final class VectorGraphicsEncoder
    extends java.lang.Object
    A helper class with static methods for saving Charts as vectors
    • Constructor Detail

      • VectorGraphicsEncoder

        private VectorGraphicsEncoder()
        Constructor - Private constructor to prevent instantiation
    • Method Detail

      • saveVectorGraphic

        public static void saveVectorGraphic​(Chart chart,
                                             java.lang.String fileName,
                                             VectorGraphicsEncoder.VectorGraphicsFormat vectorGraphicsFormat)
                                      throws java.io.IOException
        Write a chart to a file.
        Throws:
        java.io.IOException
      • saveVectorGraphic

        public static void saveVectorGraphic​(Chart chart,
                                             java.io.OutputStream os,
                                             VectorGraphicsEncoder.VectorGraphicsFormat vectorGraphicsFormat)
                                      throws java.io.IOException
        Write a chart to an OutputStream.
        Throws:
        java.io.IOException
      • addFileExtension

        public static java.lang.String addFileExtension​(java.lang.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