It is currently Fri May 29, 2015 10:03 am Advanced search

HighCharts in native iOS code...How?

Technical support, bug reports and more.

HighCharts in native iOS code...How?

Postby iamdashing » Fri Jul 27, 2012 5:22 am

Hello HighSoft Community,

I've iPad native code and the app will be commercially available but my new requirement is to add interactive graphs. I find Highcharts graph library very attractive to include. but getting no idea how can i include the graphs into my native code. Here is the exact requirement.

1. I've some data available in SQLite which need to be presented in various graphs formats.
2. I can include UIWebView in my application but don't understand how Highcharts will be included for local available data.

It will be great if you can provide a small sample application to draw highcharts in UIWebView using native code.

I highly appreciate you time to provide the solution.

NOTE: Please don't mind my basic question as i am completely new with Web Technologies and have little experience with Native iOS code.

Best Regards.
Posts: 2
Joined: Fri Jul 27, 2012 5:16 am

Re: HighCharts in native iOS code...How?

Postby iamdashing » Sat Jul 28, 2012 9:55 am

None of us have used HighCharts in Native iOS Code?
Posts: 2
Joined: Fri Jul 27, 2012 5:16 am

Re: HighCharts in native iOS code...How?

Postby eolsson » Wed Aug 01, 2012 4:14 pm

Haven't tried this myself, never even coded an iPad app.
Still, given that I don't really know, I think that it should be possible to do as long as the UIWebView is a full featured browser with SVG and javascript support.
Erik Olsson
Highsoft Solutions AS
Posts: 396
Joined: Tue May 03, 2011 1:07 pm

Re: HighCharts in native iOS code...How?

Postby ekinnear » Fri Aug 03, 2012 4:45 pm

I can confirm that this works, you can make a html file with the javascript in it, then you ask a webview to load the html string that you read in from the file that was included in your app bundle. It works, you can zoom, etc with the touch events. It actually works quite nicely.

One possible way to get the data into the chart is to include a string, such as %%%%DATA%%%% in the html file. Then, when loading the chart, you can essentially "find and replace" that string with a NSString that you built out of the SQL data (if you are already dealing with it in the app, that is). Then the chart will load with all of the data there. If it's live, you can use the javascript evaluation to add more points. There are probably much better answers than that, but it does work.
Posts: 1
Joined: Fri Aug 03, 2012 4:41 pm

Return to Highcharts Usage

Who is online

Users browsing this forum: Bing [Bot] and 10 guests