Is it possible to use iOS Charts (Daniel Gindi) to generate graphs in pdf document on iOS
NickName:Duncan Groenewald Ask DateTime:2018-05-19T06:27:44

Is it possible to use iOS Charts (Daniel Gindi) to generate graphs in pdf document on iOS

I am using iOS Charts (Daniel Gindi) to generate graphs in an iOS app and I want to be able to generate a PDF report with those graphs included in the body of the report. Can anyone explain how to go about doing this. Ideally I don't want to generate an image from the UIView that shows in the app because the size/resolution would not be suitable for the PDF document.

As I understand it there are a few options:

  1. use the graphics context for the pdf document to draw the graph on - it's not clear whether this would be possible when using the Charts library
    1. use a UIView somehow to generate the graph and generate a PDF image data from that, embed this image into the pdf report

It seems like option 1 is probably the preferred way to get best resolution/control - somewhat speculative - doing it this way means you should be able to specify the exact position and size and get the correct font sizes, line thicknesses, etc..

Using option 2 means you have to figure out the scaling between a UIView and the PDF page view and I am not sure how these would map to each other.

Can anyone provide any suggestions on the following:

  1. Is it possible to use Charts to generate graphs in a PDF document, and if so how?
  2. If not what other options are there, short of writing custom drawing code.

Copyright Notice:Content Author:「Duncan Groenewald」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/50419999/is-it-possible-to-use-ios-charts-daniel-gindi-to-generate-graphs-in-pdf-docume

More about “Is it possible to use iOS Charts (Daniel Gindi) to generate graphs in pdf document on iOS” related questions

Is it possible to use iOS Charts (Daniel Gindi) to generate graphs in pdf document on iOS

I am using iOS Charts (Daniel Gindi) to generate graphs in an iOS app and I want to be able to generate a PDF report with those graphs included in the body of the report. Can anyone explain how to...

Show Detail

date and time on x axis in ios charts by Daniel Gindi

how can i add both time and date on x axis in ios charts by Daniel Gindi? Thanks in advance for the answers! extension ChartXAxisFormatter: IAxisValueFormatter { func stringForValue(_ value: Dou...

Show Detail

Show time on x axis of the chart using Charts library by Daniel Gindi

I am using Charts library by Daniel Gindi: https://github.com/danielgindi/Charts For my project, I need to replace the x axis with time that shows only hours and minutes (HH:mm). I've created the

Show Detail

How to shift data on xAxis to right on Daniel Gindi charts?

I have a data chart DataChart would like to shift data of xAxis along with data lines to right by certain value. DataChart Screen Shot Please help me out which property to use from the library t...

Show Detail

iOS Charts: reduce height of grids in charts

Hello, I want to reduce height of grids in chart, how can I? I am using iOS-Charts(Daniel Gindi).

Show Detail

After a graph from "Charts by Daniel Cohen Gindi" graphs itself, a UIButton on the screen is no longer selectable

I am using the open-sourced Charts by Daniel Cohen Gindi: https://github.com/danielgindi/Charts I have a pie chart on my screen which graphs itself like this: //set pie chart data graphView.data =

Show Detail

How to draw horizontal stacked area chart by ios-charts

I am using iOS Charts by Daniel Gindi. I need to draw horizontal stacked area chart (Example). But I cannot find similar charts in examples of the library. I am trying to customise Horizontal Bar ...

Show Detail

Interactive Tracking with iOS Charts. How to

Using iOS Charts (by Daniel Gindi https://github.com/danielgindi/Charts), is it possible to track touching? So when I move my finger on the screen, instead of panning the graph, it would continuously

Show Detail

iOS Charts(Daniel Gindi) - how to set dual y axis dual graph lines in Swift

I am using Charts (Git Repo of Daniel Gindi's). Here is my code for single y axis single line chart: When I try to add a second line to the y axis it throws the error 'Cannot convert value of type '

Show Detail

Using both String and Date on axis charts ios

I am using Charts library by Daniel Gindi On the X axis of the line chart, I want to show 3 values (string, date, date). 1) Is it possible to format only one particular label into a string type v...

Show Detail