{"id":12501,"date":"2017-04-28T16:10:37","date_gmt":"2017-04-28T16:10:37","guid":{"rendered":"http:\/\/www.highcharts.com\/blog\/?p=12501"},"modified":"2026-01-12T09:27:38","modified_gmt":"2026-01-12T09:27:38","slug":"create-charts-highcharts-ios","status":"publish","type":"post","link":"https:\/\/www.highcharts.com\/blog\/integration\/create-charts-highcharts-ios\/","title":{"rendered":"Create mobile charts with Highcharts iOS"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>&nbsp;<br \/>\nIf you are looking for an iOS charting tool that offers a friendly API, short learning curve, and a large number of chart types, read on.\u00a0Highcharts iOS is designed specifically to simplify the process of creating, crisp, interactive charts in native iOS apps.<\/p>\n<p>Here are the simple steps involved in setting up a project with Highcharts iOS. (<a href=\"http:\/\/api.highcharts.com\/highcharts-ios\/\">Read complete API docs here<\/a>)<\/p>\n<h2>1. Preparing your project<\/h2>\n<p>First of all, you have to download the iOS Highcharts framework. To do that, choose one of the three options below:<\/p>\n<ol>\n<li>A direct download from <a href=\"https:\/\/github.com\/highcharts\/highcharts-ios\" target=\"_blank\" rel=\"noopener noreferrer\">Github<\/a>.<\/li>\n<li>Use Cocoapods by adding <code>pod 'Highcharts'<\/code> to your PodFile.<\/li>\n<li>Use Carthage by adding <code>github \"https:\/\/github.com\/highcharts\/highcharts-ios\" &gt;= 1.0.2<\/code> to your Cartfile<\/li>\n<\/ol>\n<p>Then, include the framework to your project by copying it under the folder <b>Frameworks<\/b>, if it doesn\u2019t exist just create one. Remember to check &#8220;<strong>Copy items if needed<\/strong>&#8221; option, then click on finish (see pictures below):<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-12511 aligncenter\" src=\"https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/21143900\/image01.png\" alt=\"\" width=\"263\" height=\"338\" srcset=\"https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/21143900\/image01.png 263w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/21143900\/image01-218x280.png 218w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/21143900\/image01-100x128.png 100w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/21143900\/image01-23x30.png 23w\" sizes=\"auto, (max-width: 263px) 100vw, 263px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-12512 aligncenter\" src=\"https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/21144110\/image02.png\" alt=\"\" width=\"736\" height=\"433\" srcset=\"https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/21144110\/image02.png 736w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/21144110\/image02-560x329.png 560w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/21144110\/image02-360x212.png 360w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/21144110\/image02-30x18.png 30w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/21144110\/image02-300x176.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><br \/>\nThe last task of this section is to go to your project settings and add Highcharts to <strong>Embedded Binaries<\/strong>:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-12513 aligncenter\" src=\"https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/21144206\/image00.png\" alt=\"\" width=\"867\" height=\"721\" srcset=\"https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/21144206\/image00.png 867w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/21144206\/image00-529x440.png 529w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/21144206\/image00-768x639.png 768w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/21144206\/image00-709x590.png 709w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/21144206\/image00-337x280.png 337w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/21144206\/image00-30x25.png 30w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/21144206\/image00-300x249.png 300w\" sizes=\"auto, (max-width: 867px) 100vw, 867px\" \/><br \/>\nYou are now set to use iOS Highcharts framework!<\/p>\n<h2>2. Using Highcharts (demo app)<\/h2>\n<p>To be able to use the app demo, you have to import Highcharts at the top in your <strong>AppDelegate<\/strong>. Open the file\u00a0<strong>AppDelegate.m<\/strong> and copy\/paste this line <code>#import &lt;Highcharts\/Highcharts.h&gt;<\/code>.<\/p>\n<p>To preset the chartView and set some initial options, you have to insert the following line to your <code>application:didFinishLaunchingWithOptions<br \/>\n[HIGChartView preload];<\/code><\/p>\n<p>Then include <strong>Highcharts.h<\/strong> to the View Controller. Open your ViewController.m file and write <code>#import &lt;Highcharts\/Highcharts.h&gt;<\/code>.<\/p>\n<p>If you would like to have easy access to the chart, set the property in the <strong>ViewController<\/strong> as following:<\/p>\n<pre>@interface ViewController ()\r\n@property (strong, nonatomic) HIGChartView *chartView; \r\n@end\t\r\n<\/pre>\n<p>Now, the project is set to create your first chart.<\/p>\n<h2>3. Create a chart<\/h2>\n<p>Column charts are very popular and versatile charting type, for this simple reason, our demo chart will be a column chart.<br \/>\nTo create the <strong>chartView<\/strong> with defined origin and size, add the following line in <strong>viewDidLoad<\/strong>:<\/p>\n<pre>self.chartView = [[HIGChartView alloc] initWithFrame:CGRectMake(self.view.bounds.origin.x, self.view.bounds.origin .y + 20, self.view.bounds.size.width, 300.0f)];\r\n<\/pre>\n<p>The main important piece of the chart is <strong>HIOptions<\/strong> class, as it contains all the information needed to render a chart. Actually, only the data is required to create a basic chart, but for the sake of this article let\u2019s see how you can implement more useful information.<br \/>\nBefore you implement any feature to your chart, you need to create an instance of <strong>HIOptions<\/strong> class <code>HIOptions *options = [[HIOptions alloc]init];<\/code><\/p>\n<p>It is a good habit to specify chart\u2019s type. To do so, create HIChart class object and set its type to \u201ccolumn\u201d<\/p>\n<pre>HIChart *chart = [[HIChart alloc]init]; \r\nchart.type = @\"column\";\t\r\noptions.chart = chart;\r\n<\/pre>\n<p>It is always wise to set a title to a chart, as it adds more clarity to the users about the purpose of the chart:<\/p>\n<pre>HITitle *title = [[HITitle alloc]init]; \r\ntitle.text = @\"Demo chart\";\t\t\t\t\t\t\t\t\r\noptions.title = title;\r\n<\/pre>\n<p>Now, it is time to introduce the data. Keep in mind that because the chart is a column type chart, you need to use <strong>HIColumn<\/strong> data series prior starting writing the data:<\/p>\n<pre>HIColumn *series = [[HIColumn alloc]init];\r\nseries.data = @[@49.9, @71.5, @106.4, @129.2, @144, @176, @135.6, @148.5, @216.4, @194.1, @95.6, @54.4];\r\n<\/pre>\n<p>The <strong>Options<\/strong> feature is designed to store multiple series. In this demo, you need only one series defined as one-element-array <code>options.series = @[series];<\/code><\/p>\n<p>Don\u2019t forget to link the options feature to the chartView <code>self.chartView.options = options;<\/code><br \/>\nThen, add <strong>chartView<\/strong> as <strong>subview<\/strong> to your View Controller\u2019s view <code>[self.view addSubview:self.chartView];<\/code><br \/>\nThat\u2019s it! You are now set to run the demo :).<\/p>\n<p>Your <strong>View Controller .m<\/strong> file should look like this code:<\/p>\n<pre>#import \"ViewController.h\"\r\n#import &lt;Highcharts\/Highcharts.h&gt;\r\n\r\n@interface ViewController ()\r\n@property (strong, nonatomic) HIGChartView *chartView;\r\n@end\r\n\r\n@implementation ViewController\r\n\r\n- (void)viewDidLoad {\r\n    [super viewDidLoad];\r\n    \/\/ Do any additional setup after loading the view, typically from a nib.\r\n    self.chartView = [[HIGChartView alloc] initWithFrame:CGRectMake(self.view.bounds.origin.x, self.view.bounds.origin.y + 20, self.view.bounds.size.width, 300.0f)];\r\n    \r\n    HIOptions *options = [[HIOptions alloc]init];\r\n    \r\n    HIChart *chart = [[HIChart alloc]init];\r\n    chart.type = @\"column\";\r\n    options.chart = chart;\r\n    \r\n    HITitle *title = [[HITitle alloc]init];\r\n    title.text = @\"Demo chart\";\r\n    options.title = title;\r\n    \r\n    HIColumn *series = [[HIColumn alloc]init];\r\n    series.data = @[@49.9, @71.5, @106.4, @129.2, @144, @176, @135.6, @148.5, @216.4, @194.1, @95.6, @54.4];\r\n    options.series = @[series];\r\n    self.chartView.options = options;\r\n    \r\n    [self.view addSubview:self.chartView];\r\n}\r\n- (void)didReceiveMemoryWarning {\r\n    [super didReceiveMemoryWarning];\r\n    \/\/ Dispose of any resources that can be recreated.\r\n}\r\n@end\r\n<\/pre>\n<p>Press \u201cRun\u201d in XCode, and Voila! You have your chart with just a few steps.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-12672 size-full\" src=\"https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/28154927\/iOS-demo.png\" alt=\"\" width=\"438\" height=\"434\" srcset=\"https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/28154927\/iOS-demo.png 438w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/28154927\/iOS-demo-283x280.png 283w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/28154927\/iOS-demo-32x32.png 32w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/28154927\/iOS-demo-50x50.png 50w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/28154927\/iOS-demo-64x64.png 64w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/28154927\/iOS-demo-96x96.png 96w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/28154927\/iOS-demo-128x128.png 128w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/28154927\/iOS-demo-129x128.png 129w, https:\/\/wp-assets.highcharts.com\/www-highcharts-com\/blog\/wp-content\/uploads\/2017\/04\/28154927\/iOS-demo-30x30.png 30w\" sizes=\"auto, (max-width: 438px) 100vw, 438px\" \/><br \/>\nFeel free to add more features and personalize your chart using colors, labels, etc.<\/p>\n<p>The best way to really grasp the capabilities that iOS Highcharts offers you is by creating charts and be creative. To explore more advanced features take a look at <a href=\"https:\/\/github.com\/highcharts\/highcharts-ios\/tree\/master\/Example\/HighFit\" target=\"_blank\" rel=\"noopener noreferrer\">demo app HighFit<\/a> provided by Highcharts or read the following <a href=\"http:\/\/api.highcharts.com\/highcharts-ios\/\" target=\"_blank\" rel=\"noopener noreferrer\">documentation<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to create interactive mobile native app charts with Highcharts iOS.<\/p>\n","protected":false},"author":32,"featured_media":13175,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"meta_title":"","meta_description":"","hc_selected_options":[],"footnotes":""},"categories":[1105],"tags":[1094,1031],"coauthors":[699],"class_list":["post-12501","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-integration","tag-highcharts-core","tag-javascript"],"_links":{"self":[{"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/posts\/12501","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/users\/32"}],"replies":[{"embeddable":true,"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/comments?post=12501"}],"version-history":[{"count":1,"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/posts\/12501\/revisions"}],"predecessor-version":[{"id":29096,"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/posts\/12501\/revisions\/29096"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/media\/13175"}],"wp:attachment":[{"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/media?parent=12501"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/categories?post=12501"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/tags?post=12501"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.highcharts.com\/blog\/wp-json\/wp\/v2\/coauthors?post=12501"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}