JBChartView
iOS-based charting library for both line and bar graphs.
An iOS library from Jawbone for drawing animated line and bar charts inside iPhone and iPad apps, using the familiar table-view data-source pattern iOS developers already know.
JBChartView is an iOS charting library for drawing line graphs and bar graphs inside iPhone and iPad apps. It was built and released by Jawbone, the fitness wearable company. The library is a drop-in UIView subclass, meaning you add it to a screen the same way you would add any other visual element in an iOS project.
The programming interface follows the same data source and delegate pattern that iOS developers already know from UITableView, which is the standard list component on the platform. To display a bar chart, you implement two short methods: one that returns how many bars to draw, and another that returns the height of each bar. The library normalizes the values automatically to fit the available space. Line charts work similarly, with methods that return how many lines and how many data points each line should have.
Both chart types support animated reloads, where bars or lines animate smoothly from their old values to new ones. Filled areas under line charts cannot animate due to a limitation in Apple's graphics framework, but the lines themselves do animate. The library supports customization of colors, widths, selection highlights, and other visual properties through a separate customization guide in the repository.
Installation is done via CocoaPods by adding one line to a project's Podfile, or by dragging the source files directly into Xcode. Swift projects are supported through a bridging header. The library requires iOS 6 or later and Automatic Reference Counting. A demo project is included in the repository that shows both chart types and demonstrates the available customization options.
Where it fits
- Add an animated bar chart to an iOS fitness app to show weekly activity data
- Display a multi-line graph in an iPhone dashboard app showing trends over time
- Embed a bar chart in a Swift iOS project using the Objective-C bridging header
- Show animated transitions when updating chart data in an iPad analytics view