TKRadarChart
A customizable radar chart in Swift
Requirements
- iOS 8.0+
- Xcode 9.0
- Swift 4.0
Installation
CocoaPods
You can use CocoaPods to install TKRadarChart by adding it to your Podfile:
platform :ios, '8.0'
use_frameworks!
pod 'TKRadarChart'To get the full benefits import TKRadarChart wherever you import UIKit
import UIKit
import TKRadarChartCarthage
Create a Cartfile that lists the framework and run carthage update. Follow the instructions to add $(SRCROOT)/Carthage/Build/iOS/TKRadarChart.framework to an iOS project.
github "tbxark/TKRadarChart"Manually
- Download and drop
TKRadarChart.swiftin your project. - Congratulations!
Usage example
Base
| Base | Description | Demo |
|---|---|---|
| Step | Background polygon laps(min 1) | ![]() |
| Row | Number of edges of polygon (min 3) | ![]() |
| Section | At the same time show the number of data | ![]() |
TKRadarChartConfig
This structure is used for custom charts
var radius: CGFloat
var minValue: CGFloat
var maxValue: CGFloat
var showPoint: Bool
var showBorder: Bool
var fillArea: Bool
var clockwise: Bool
var autoCenterPoint: BoolTKRadarChartDataSource
This protocol represents the data model object. as such, it supplies no information about appearance
protocol TKRadarChartDataSource: class {
func numberOfStepForRadarChart(radarChart: TKRadarChart) -> Int
func numberOfRowForRadarChart(radarChart: TKRadarChart) -> Int
func numberOfSectionForRadarChart(radarChart: TKRadarChart) -> Int
func titleOfRowForRadarChart(radarChart: TKRadarChart, row: Int) -> String
func valueOfSectionForRadarChart(withRow row: Int, section: Int) -> CGFloat
}TKRadarChartDelegate
This represents the display and behaviour of the TKRadarChart.
protocol TKRadarChartDelegate: class {
func colorOfTitleForRadarChart(radarChart: TKRadarChart) -> UIColor
func colorOfLineForRadarChart(radarChart: TKRadarChart) -> UIColor
func colorOfFillStepForRadarChart(radarChart: TKRadarChart, step: Int) -> UIColor
func colorOfSectionFillForRadarChart(radarChart: TKRadarChart, section: Int) -> UIColor
func colorOfSectionBorderForRadarChart(radarChart: TKRadarChart, section: Int) -> UIColor
}Release History
-
1.4.3 Upgrade to swift 4.2
-
1.4.2 Fix bugs that can not change the title font
-
1.4.1 Fix warnign
-
1.4.0 Upgrade to swift 4.0
-
1.3.1 Upgrade framework config
-
1.3.0 Support swift 3.0
-
1.0.1 Complete basic functions, add Cocoapod and Carthage support
Contribute
We would love for you to contribute to TKRadarChart, check the LICENSE file for more info.
Meta
TBXark – @tbxark – [email protected]
Distributed under the MIT license. See LICENSE for more information.




