GaugeView is a small library to create and display Gauge graphs. It is fully customizable: you can set the color, size, text and many other properties of the graph. Do you need to display data in a simple way? Or you just wanto to add a fancy donut to your app? This is the library you were looking for!
- iOS 8+
- Xcode 7.0+
Add the GaugeView pod into your project and run pod install
pod 'GaugeView'
Download GaugeVIew and import GaugeView.swift
and GaugeLayer.swift
inside your xcode project.
To start using GaugeView you can build the provided example project
- Open
Example/GaugeView.xcodeproj
in Xcode. - Build and run.
It's very easy to set up, just import GaugeView in your Swift code:
import GaugeView
Add an UIView with interface builder and set GaugeView
as UIView custom class.
Link it with the outlet property declared in your code.
@IBOutlet private weak var gaugeView: GaugeView!
It's simple to customize! Here's an example of configuration of the view. Look at the Customization section for more details.
gaugeView.percentage = 80
gaugeView.thickness = 5
gaugeView.labelFont = UIFont.systemFontOfSize(40, weight: UIFontWeightThin)
gaugeView.labelColor = UIColor.lightGrayColor()
gaugeView.gaugeBackgroundColor = UIColor.lightGrayColor()
Declare a variable with GaugeView type
private var gaugeView: GaugeView!
Instantiate and customize it. Make it fancy! Look at the Customization section to see more details.
gaugeView = GaugeView(frame: CGRect(x: 0, y:0, width: 100, height: 100)
gaugeView.percentage = 80
gaugeView.thickness = 5
gaugeView.labelFont = UIFont.systemFontOfSize(40, weight: UIFontWeightThin)
gaugeView.labelColor = UIColor.lightGrayColor()
gaugeView.gaugeBackgroundColor = UIColor.lightGrayColor()
These are the customizable properties:
- Float
startAngle
- CGFloat
thickness
- Float
percentage
- UIColor
gaugeBackgroundColor
- UIColor
gaugeColor
- Float
animationDuration
- String
labelText
- UIFont
labelFont
- UIColor
labelColor
GaugeView is Copyright (c) 2015 Belka, srl. It is free software, and may be redistributed under the terms specified in the LICENSE file.
Belka is a Digital Agency specialized in design, mobile applications development and custom solutions. We love open source software! You can see our projects or look at our case studies.
Interested? Hire us to help build your next amazing project.