CNChart is an open source library making it easy to create beautiful, highly customizable, animated Bar Chart for iOS.
Learn more about the CNChart project, licensing, support etc.
An Example Project shows up how to use, and what things you can costomize.
Sample images of example project are blow.
Vertical Style | Horizontal Style |
![]() |
![]() |
- Requires iOS 9 or later. The sample project is optimized for iOS 13.
- Requires Automatic Reference Counting (ARC).
- Optimized for ARM64 Architecture.
It only takes a few simple steps to install and setup CNChart to your project.
Add https://github.com/Chanooo/CNChart
as a dependency to your Package.swift file or select File -> Swift Packages -> Add Package Dependency...
in Xcode.
The easiest way to install CNChart is to use CocoaPods. To do so, simply add the following line to your Podfile
:
pod 'CNChart'
Programmatical Initialization
Just add the following code to your implementation (usually in the viewDidLoad
method of your View Controller).
let chart = CNChart(axis: .horizontal) // or .vertical
self.view.addSubview(chart)
Interface Builder Initialization
1 - Drag a UIStackView (Horizontal or Vertical)
to your UIViewController
.
2 - Change the class of the new UIStackView
to CNChart
.
3 - (Option) If interface builder occurs an error, you could put fixed sized UIView inside of UIStackView.
4 - Select the CNChart
and open the Attributes Inspector. Most of the customizable properties can easily be set from the Attributes Inspector. The Sample App demonstrates this capability.
iOS Developer CNOO, [email protected]
CNChart is available under the MIT license. See the LICENSE file for more info. See the License. You are free to make changes and use this in either personal or commercial projects. Attribution is not required, but highly appreciated. A little "Thanks!" (or something to that affect) is always welcome. If you use CNChart in your app, please let me know!