Latest 1.0.1
Homepage https://github.com/mevalid/MTCircleChart
License MIT
Platforms ios 9.0
Authors

MultiTypeCircleChart

Circle chart with percentage slide template. Can be used for diagram, graph, chart, report, data visualization, presentation.

MTCircleChart

Requirements

  • Xcode 8.0+
  • Swift 4.0+

Installation

MTCircleChart is available through CocoaPods. You can install it with the following command:

$ gem install cocoapods
platform :ios, '9.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'MTCircleChart'
end

Then, run the following command:

$ pod install

Example

import MTCircleChart

class ViewController: UIViewController {

    let circleChart: MTCircleChart = {

        let mainColor = UIColor(red: 185/255, green: 212/255, blue: 235/255, alpha: 1.0)
        let textColor = UIColor(red: 75/255, green: 118/255, blue: 176/255, alpha: 1.0)

        let v = MTCircleChart(tracks: [
            MTTrack(value: 86, total: 100, color: mainColor, text: "CONNECTICUT"),
            MTTrack(value: 82, total: 100, color: mainColor.withAlphaComponent(0.75), text: "ALABAMA"),
            MTTrack(value: 75, total: 100, color: mainColor.withAlphaComponent(0.45), text: "NEVADA"),
            MTTrack(value: 70, total: 100, color: mainColor.withAlphaComponent(0.15), text: "UTAH")
            ], MTConfig(textColor: textColor))
        v.translatesAutoresizingMaskIntoConstraints = false
        v.backgroundColor = .white
        return v
    }()

    // MARK: View Lifecycle
    override func viewDidLoad() {
        super.viewDidLoad()
        view.addSubview(circleChart)
        layout()
    }

    // MARK: Layout
    private func layout() {
        NSLayoutConstraint.activate(
            NSLayoutConstraint.constraints(withVisualFormat: "H:|[view]|", options: [], metrics: nil, views: ["view": circleChart])
        )
        NSLayoutConstraint.activate(
             NSLayoutConstraint.constraints(withVisualFormat: "V:|[view]|", options: [], metrics: nil, views: ["view": circleChart])
        )
    }
}

License

MTCircleChart is released under the MIT license. See LICENSE for details.

Latest podspec

{
    "name": "MTCircleChart",
    "version": "1.0.1",
    "summary": "Multi type circle chart.",
    "description": "Circle chart with percentage slide template. Can be used for diagram, graph, chart, report, data visualization, presentation.",
    "homepage": "https://github.com/mevalid/MTCircleChart",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Mirela": "[email protected]"
    },
    "source": {
        "git": "https://github.com/mevalid/MTCircleChart.git",
        "tag": "1.0.1"
    },
    "source_files": [
        "MTCircleChart",
        "MTCircleChart/**/*.{h,m}"
    ],
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "4.0"
    },
    "swift_version": "4.0",
    "platforms": {
        "ios": "9.0"
    }
}

Pin It on Pinterest

Share This