Simple Rader Chart written in Swift.
To run the example project, clone the repo, and run pod install
from the Example directory first.
import UIKit
import Yashin
class SomeViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let radarChart = Yashin(frame: self.view.frame)
self.view.addSubview(radarChart)
radarChart.set(
["shoot", "pass", "dribble", "speed", "power", "stamina", "mentality"],
[([8,9,8,8,7,6,9], UIColor.greenColor().colorWithAlphaComponent(0.40))]
)
}
}
// param
radarChart.maxValue = 100 // Max value of chart. Default is 10
radarChart.minValue = 0 // Min value of chart. Default is 0
// appearance
radarChart.padding = 100 // Padding from chart to outline frame. Default is 60.0
radarChart.fontSize = 13.0 // Font size. Default is 11.0
radarChart.scaleLineWidth = 4.0 // Scale-line width. Default is 2.0
radarChart.scaleLineHidden = false // Scale-line hidden flag. Default is false
// color
radarChart.lineColor = UIColor.brownColor() // Color of chart outer-line. Default is UIColor.darkGrayColor()
radarChart.subLineColor = UIColor.lightGrayColor() // Color of chart inner-line. Default is UIColor.darkGrayColor().colorWithAlphaComponent(0.50)
radarChart.set(
["shoot", "pass", "dribble", "speed", "power", "stamina", "mentality"],
[([84,91,88,83,75,60,94], UIColor.greenColor().colorWithAlphaComponent(0.40))]
)
radarChart.set(
["shoot", "pass", "dribble", "speed", "power", "stamina", "mentality"],
[
([6,9,5,8,7,4,6], UIColor.greenColor().colorWithAlphaComponent(0.40)),
([7,6,7,7,8,8,6], UIColor.blackColor().colorWithAlphaComponent(0.40)),
([8,7,8,7,7,9,5], UIColor.redColor().colorWithAlphaComponent(0.40))
]
)
- iOS 9.0 or later
- Xcode 7.2
Add the following to your Cartfile:
github "ushisantoasobu/Yashin"
And run carthage update
, then add the framework as described in Carthage Readme
Yashin is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "Yashin"
ushisantoasobu, [email protected]
Yashin is available under the MIT license. See the LICENSE file for more info.