Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/cagricolak/CoreCharts

Core Charts | Basic Scrollable Chart Library for iOS
https://github.com/cagricolak/CoreCharts

barchart chart charts cocoapods corecharts ios swift-library

Last synced: about 2 months ago
JSON representation

Core Charts | Basic Scrollable Chart Library for iOS

Lists

README

        

# Core Charts | Basic Chart Library for iOS
[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/CoreCharts.svg)](https://img.shields.io/cocoapods/v/CoreCharts.svg)
![CocoaPods Compatible](https://img.shields.io/badge/Platform-iOS-lightgrey.svg)

| HCoreBarChart | VCoreBarChart |
| ------------- | ------------- |
| | |

- [Requirements](#requirements)
- [Installation](#installation)
- [Usage](#usage)
- [Appearance Customization](appearance-customization)

## Getting Started

You need a Cocoapods installed mac, if you are not familiar that visit here [CocoaPods](https://guides.cocoapods.org/using/getting-started.html#getting-started)

### Requirements

* XCode 8.3+
* iOS 9.3+

### Installation

Add your pod file
```
pod 'CoreCharts'
```
and than hit the your command line
```
pod install
```

now you are ready to use CoreCharts

## Usage

import where you want to use

```swift
import CoreCharts

```

and than open up your storyboard or xib file and add new UIView drop your main view. afterwards change subclass to Vertical for VCoreBarChart or Horizontal chart for HCoreBarChart

![alt text](https://github.com/cagricolak/CoreCharts/blob/master/docs/Storyboard-usage.png "Storyboard reference")

referance it!
```swift
@IBOutlet weak var barChart: VCoreBarChart!
```

most important setup is ready, now you can use some of featuristic CoreChart's properties.

firstly you need conform your class to data source protocol,

```swift
class DemoViewController: UIViewController,CoreChartViewDataSource {

@IBOutlet weak var barChart: VCoreBarChart!

override func viewDidLoad() {
super.viewDidLoad()

barChart.dataSource = self
}
```

now, you have two methods, implement it.

```swift
func loadCoreChartData() -> [CoreChartEntry]

optional func didTouch(entryData: CoreChartEntry)
```

loadCoreChartData method is fill your bar charts, you need to convert your data to CoreChartEntry type

```swift
func loadCoreChartData() -> [CoreChartEntry] {

var allCityData = [CoreChartEntry]()

let cityNames = ["Istanbul","Antalya","Ankara","Trabzon","İzmir"]

let plateNumber = [34,07,06,61,35]

for index in 0.. [CoreChartEntry] {

return getTurkeyFamouseCityList()

}


func getTurkeyFamouseCityList()->[CoreChartEntry] {
var allCityData = [CoreChartEntry]()
let cityNames = ["Istanbul","Antalya","Ankara","Trabzon","İzmir"]
let plateNumber = [34,07,06,61,35]

for index in 0..