Home

Awesome

TKRadarChart

A customizable radar chart in Swift

Xcode 9.0+ iOS 8.0+ Swift 4.0+ Build Status CocoaPods Carthage compatible License MIT

Requirements

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 TKRadarChart

Carthage

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

  1. Download and drop TKRadarChart.swift in your project.
  2. Congratulations!

Usage example

Base

BaseDescriptionDemo
StepBackground polygon laps(min 1)image image
RowNumber of edges of polygon (min 3)image image
SectionAt the same time show the number of dataimage image

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: Bool

TKRadarChartDataSource

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

Contribute

We would love for you to contribute to TKRadarChart, check the LICENSE file for more info.

Meta

TBXark – @tbxarktbxark@outlook.com

Distributed under the MIT license. See LICENSE for more information.

https://github.com/TBXark