/** * Saves the current state of the chart to the gallery as a PNG image. * NOTE: Needs permission WRITE_EXTERNAL_STORAGE * * @param fileName e.g. "my_image" * @return returns true if saving was successful, false if not */ public boolean saveToGallery(String fileName) { return saveToGallery(fileName, "", "MPAndroidChart-Library Save", Bitmap.CompressFormat.PNG, 40); }
/** * Saves the current state of the chart to the gallery as a JPEG image. The * filename and compression can be set. 0 == maximum compression, 100 = low * compression (high quality). NOTE: Needs permission WRITE_EXTERNAL_STORAGE * * @param fileName e.g. "my_image" * @param quality e.g. 50, min = 0, max = 100 * @return returns true if saving was successful, false if not */ public boolean saveToGallery(String fileName, int quality) { return saveToGallery(fileName, "", "MPAndroidChart-Library Save", Bitmap.CompressFormat.PNG, quality); }
protected abstract void saveToGallery(); }
/** * Saves the current state of the chart to the gallery as a JPEG image. The * filename and compression can be set. 0 == maximum compression, 100 = low * compression (high quality). NOTE: Needs permission WRITE_EXTERNAL_STORAGE * * @param fileName e.g. "my_image" * @param quality e.g. 50, min = 0, max = 100 * @return returns true if saving was successful, false if not */ public boolean saveToGallery(String fileName, int quality) { return saveToGallery(fileName, "", "MPAndroidChart-Library Save", Bitmap.CompressFormat.JPEG, quality); }
/** * Saves the current state of the chart to the gallery as a JPEG image. The * filename and compression can be set. 0 == maximum compression, 100 = low * compression (high quality). NOTE: Needs permission WRITE_EXTERNAL_STORAGE * * @param fileName e.g. "my_image" * @param quality e.g. 50, min = 0, max = 100 * @return returns true if saving was successful, false if not */ public boolean saveToGallery(String fileName, int quality) { return saveToGallery(fileName, "", "MPAndroidChart-Library Save", Bitmap.CompressFormat.JPEG, quality); }
/** * Saves the current state of the chart to the gallery as a JPEG image. The * filename and compression can be set. 0 == maximum compression, 100 = low * compression (high quality). NOTE: Needs permission WRITE_EXTERNAL_STORAGE * * @param fileName e.g. "my_image" * @param quality e.g. 50, min = 0, max = 100 * @return returns true if saving was successful, false if not */ public boolean saveToGallery(String fileName, int quality) { return saveToGallery(fileName, "", "MPAndroidChart-Library Save", Bitmap.CompressFormat.JPEG, quality); }
/** * Saves the current state of the chart to the gallery as a JPEG image. The * filename and compression can be set. 0 == maximum compression, 100 = low * compression (high quality). NOTE: Needs permission WRITE_EXTERNAL_STORAGE * * @param fileName e.g. "my_image" * @param quality e.g. 50, min = 0, max = 100 * @return returns true if saving was successful, false if not */ public boolean saveToGallery(String fileName, int quality) { return saveToGallery(fileName, "", "MPAndroidChart-Library Save", Bitmap.CompressFormat.JPEG, quality); }