📈 Easily Create Hyper-Minimal Charts 📊
All charts are created throught the MinChartKit
struct
, by first injecting the data:
let data = [1.0,3.0,5.0,7.0,3.0,...]
let minChartKit = MinChartKit(data:data)
Then calling the type of chart you want to make with the data and passing that chart as a parameter:
...
let minLine = (pull from storyboard)
minChartKit.line(minLine)
As noted above, the MinLine
or MinBar
charts can be used in your storyboard and connected through an @IBOutlet
.
You can also inject a color for your chart on instantiation of the MinChartKit
struct
:
...
let minChartKit = MinChartKit(data:data, color:.blue)
minChartKit.bar(minBar)
MinChartKit is built on top of Charts
, and therefore the min charts have access to the parent classes methods and parameters:
// animate drawing of a line
minLine.animate(xAxisDuration: 1.682)
This also allows the ability to fully customize the MinLine
chart in any way you would customize the LineChartView
class. Take a look at the Charts
docs for more details.
The easiest way to use MinChartKit is with CocoaPods
To integrate MinChartKit into your Xcode project using CocoaPods, specify it in your Podfile
:
platform :ios, '11.0'
target 'TargetName' do
pod 'MinChartKit'
end
Then, run the following command:
$ pod install
This is a pre-release version of MinChartKit and although it is stable and should be working in all the above cases, things will be added, changed and potentially break.
MinChartKit is released under an MIT license. So use it how ever you want.