Skip to content

Code for making various charts in Swift; nothing too fancy but enough to get an app and and running

License

Notifications You must be signed in to change notification settings

msimms/SimpleSwiftCharts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SimpleSwiftCharts

Code for making various charts in Swift; nothing too fancy but it'll do if you just need to add a simple bar or line chart to your app so you can get up and running.

  • BarChartView.swift

Line Graph

var splits: Array<Double> = [134.0,149.0,163.0,178.0,193.0]
var result: Array<Bar> = []

for split in splits {
	result.append(Bar(value: Double(split), label: Int(split), description: ""))
}

BarChartView(bars: makeSplitGraphBar(splits: mileSplits), color: Color.red, units: "")
  • LineGraphView.swift

Line Graph

func hrFormatter(num: Double) -> String {
	return String(format: "%0.0f", num)
}

LineGraphView(points: self.data, color: Color.red, formatter: self.hrFormatter)

Building

Just add this repo to your project as a submodule and then add the source files directly to your project in XCode.

License

This is open source software and is released under the MIT license.

About

Code for making various charts in Swift; nothing too fancy but enough to get an app and and running

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages