Latest 0.0.3
Homepage https://github.com/stevewight/ChartDynamicKit
License MIT
Platforms ios 11.0
Dependencies MinChartKit
Authors

📈 Easily Create Hyper-Minimal Dynamic Charts 📉

Usage

A dynamic chart is created through the ChartDynamicKit object.

Instantiate

var chartDynamic = ChartDynamicKit(
    line: minLine
)

Note: minLine is an @IBOutlet from the storyboard.

Set Data

chartDynamic.set(data:myData)

Note: myData is an array of Double‘s

Start

chartDynamic.start()

Depending on your data, your chart will look something like this:

ChartDynamicKit

Stop

You can easily stop the chart with:

chartDynamic.stop()

or let the framework handle state change with:

chartDynamic.toggleState()

Delegate

To get notified when the chart updates or to add a marker to the chart conform to the ChartDynamicDelegate:

chartDynamic.delegate = self

The two methods available are:

chartDynamicUpdate(index:Int)

Called each time the chart changes

func chartDynamicUpdate(index: Int) {
    let value = myData[index]
    updateUI(value)
}

chartDynamicMarkerTag(index: Int)->MarkerTag?

To pass a marker if the index requires it (or nil)

func chartDynamicMarkerTag(index: Int)->MarkerTag? {
    let value = myData[index]
    if shouldBeMarked(value) {
        return MarkerTag(name:"Hello", value:value)
    } else { return nil }
}

Depending on your data and how your shouldBeMarked(value) method is implemented, your chart will look something like this:

ChartDynamicKit

On the Sholders…

ChartDynamicKit is built on top of MinChartKit and leverages the MinLine class at it’s core.

Take a look at the MinChartKit README for more details.

Installation

The easiest way to use MinChartKit is with CocoaPods

Installation with CocoaPods

To integrate ChartDynamicKit into your Xcode project using CocoaPods, specify it in your Podfile:

platform :ios, '11.0'

target 'TargetName' do
  pod 'ChartDynamicKit'
end

Then, run the following command:

$ pod install

Pre-Release Version

This is a pre-release version of ChartDynamicKit and although it is stable and should be working in all the above cases, things will be added, changed and potentially break.

License

ChartDynamicKit is released under an MIT license.

Latest podspec

{
    "name": "ChartDynamicKit",
    "version": "0.0.3",
    "summary": "Easily Create Hyper-Minimal Dynamic Charts",
    "homepage": "https://github.com/stevewight/ChartDynamicKit",
    "license": "MIT",
    "authors": {
        "Steve Wight": "[email protected]"
    },
    "platforms": {
        "ios": "11.0"
    },
    "source": {
        "git": "https://github.com/stevewight/ChartDynamicKit.git",
        "tag": "0.0.3"
    },
    "source_files": "ChartDynamicKit/**/*.{h,m,swift}",
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "4"
    },
    "dependencies": {
        "MinChartKit": []
    }
}

Pin It on Pinterest

Share This