Highcharts iOS wrapper allows you to add custom fonts. If you have your own font and want to use that in your chart, follow next steps:
- Add a font file to your project. Select File -> Add Files to “Your Project Name” from the menu bar or drag and drop the file into your Xcode project, check Copy items if needed option and add the font to your app target.
- Add your font to
HIChartView
. To do this, firstly, you need to get an absolute path pointing to the location of the font and then calladdFont:
method:
NSString *fontPath = [[NSBundle mainBundle] pathForResource:@"Windsong" ofType:@"ttf"]; [HIChartView addFont:fontPath];
So, now you can use a custom font in your chart. For example, let's change the chart title font. You only need to create a style object for the title and set its font family to the font file name:
title.style = [[HICSSObject alloc] init]; title.style.fontFamily = @"Windsong";
Original info at: the Highcharts iOS GitHub repository