-
-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
big snap shot #2034
Comments
what you mean? a snapshot of the chart view? Use UIKit or CoreGraphics APIs can do so. /// Saves the current chart state with the given name to the given path on
/// the sdcard leaving the path empty "" will put the saved file directly on
/// the SD card chart is saved as a PNG image, example:
/// saveToPath("myfilename", "foldername1/foldername2")
///
/// - parameter to: path to the image to save
/// - parameter format: the format to save
/// - parameter compressionQuality: compression quality for lossless formats (JPEG)
///
/// - returns: `true` if the image was saved successfully
open func save(to path: String, format: ImageFormat, compressionQuality: Double) -> Bool
{
guard let image = getChartImage(transparent: format != .jpeg)
else { return false }
var imageData: Data!
switch (format)
{
case .png:
imageData = NSUIImagePNGRepresentation(image)
break
case .jpeg:
imageData = NSUIImageJPEGRepresentation(image, CGFloat(compressionQuality))
break
}
do
{
try imageData.write(to: URL(fileURLWithPath: path), options: .atomic)
}
catch
{
return false
}
return true
} |
I want to get image that show the total chart |
Then the code I posted can do that.
|
i know but it take only the part of chart that shown in view not total chart |
would you post a screenshot and your code to explain? I checked the code, it's supposed to render your chart view as image. |
How can i get big snap shot for all data i show in chart ?
The text was updated successfully, but these errors were encountered: