CalendarHeatmap
CalendarHeatmap is a calendar based heatmap which presenting a time series of data points in colors, inspired by Github contribution chart, and written in Swift.
Installation
CalendarHeatmap is available through CocoaPods. To install
it, simply add the following line to your Podfile:
CalendarHeatmap is also availabel through Carthage, by adding it to your Cartfile:
Usage
CalendarHeatmapConfig
details.
Config Key | Type | Default |
---|---|---|
backgroundColor | UIColor | UIColor.white |
contentRightInset | CGFloat | 60 |
itemColor | UIColor | UIColor.clear |
itemSide | CGFloat | 20 |
interitemSpacing | CGFloat | 4 |
lineSpacing | CGFloat | 4 |
weekDayColor | UIColor | UIColor.black |
weekDayStrings | [String] | DateFormatter().shortWeekdaySymbols.map{ \$0.capitalized } |
weekDayFont | UIFont | UIFont.systemFont(ofSize: 12, weight: .medium) |
weekDayWidth | CGFloat | 30 |
monthColor | UIColor | UIColor.black |
monthStrings | [String] | DateFormatter().monthSymbols |
monthFont | UIFont | UIFont.systemFont(ofSize: 12, weight: .medium) |
monthHeight | CGFloat | 20 |
Make your ViewController
adopts CalendarHeatmapDelegate
Demo
Take a look at Example
, to run the example project, clone the repo, and run pod install
from the Example directory first.
Author
Zacharysp, dongjiezach@gmail.com