Skip to content
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

How to save image of scrollable graph #3819

Closed
1 task
pcmanik opened this issue Jan 16, 2019 · 2 comments
Closed
1 task

How to save image of scrollable graph #3819

pcmanik opened this issue Jan 16, 2019 · 2 comments

Comments

@pcmanik
Copy link

pcmanik commented Jan 16, 2019

What did you do?

I'm saving LineChartView as image into user photo library using

let chartImage = chartView.getChartImage(transparent: false)
UIImageWriteToSavedPhotosAlbum(chartImage, nil, nil, nil)

Content of this chart can't fit into chart view so user is able to scroll it.

What did you expect to happen?

I'm excepting that the resulting image will contain the whole chart. Or at least multiple images.

What happened instead?

Resulting image contains only the visible portion of the chart

Charts Environment

Charts version/Branch/Commit Number: 3.2.1
Xcode version: 10.1
Swift version: 4.2.1
Platform(s) running Charts: iOS
macOS version running Xcode: 10.14.1

@pcmanik pcmanik closed this as completed Jan 17, 2019
@vaibhav-nickelfox
Copy link

Hey @pcmanik you got the solution of this?

@pcmanik
Copy link
Author

pcmanik commented Aug 20, 2021

@vaibhav-nickelfox I've used one "hack". Before requesting the image i expand the width constraint of the view to the full width of chart. Than I create the image. After it's processed I shrink the width constraint back to original width.

But there were still some issues so in the end I've created my own simple library for plotting ECG graph.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants