A powerful and lightweight charting library for iOS featuring CoreChartView.
Designed for performance, flexibility, and ease of use.
ChartSwift-Kit์ ๋์ฉ๋ ๋ฐ์ดํฐ๋ฅผ ๋น ๋ฅด๊ณ ๋ถ๋๋ฝ๊ฒ ์๊ฐํํ๊ธฐ ์ํด ์ค๊ณ๋ ๊ณ ์ฑ๋ฅ iOS ์ฐจํธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์
๋๋ค. ์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๋ฉ์ธ ์ปดํฌ๋ํธ๋ **CoreChartView**์ด๋ฉฐ, ์ง๊ด์ ์ธ API์ ๊ฐ๋ ฅํ ์ปค์คํฐ๋ง์ด์ง ์ต์
์ ์ ๊ณตํ์ฌ ์ด๋ค iOS ์ฑ์๋ ์ฝ๊ฒ ํตํฉํ ์ ์์ต๋๋ค.
- ๐ ์๋์ ์ธ ์ฑ๋ฅ: ์๋ง ๊ฐ์ ๋ฐ์ดํฐ ํฌ์ธํธ๋ ๋๊น ์์ด ์ฒ๋ฆฌํ๋ ์ฒญํฌ ๊ธฐ๋ฐ ๋ ๋๋ง ๋ฐ LTTB ๋ค์ด์ํ๋ง.
- ๐จ ๋ค์ํ ์ฐจํธ ํ์ : ๋ผ์ธ(Line), ๋ฐ(Bar), ์์ญ(Area), ํฌ์ค ๋ฐ์ดํฐ(HealthData) ๋ฑ ํ์ ์ฐจํธ ํ์ ์ ๋ชจ๋ ์ง์.
- ๐ ์ง๊ด์ ์ธ ์ ์ค์ฒ: ํ์น(Pinch)๋ก ํ๋/์ถ์ํ๊ณ , ํฌ(Pan)์ผ๋ก ์คํฌ๋กคํ๋ฉฐ ๋ฐ์ดํฐ๋ฅผ ์์ ๋กญ๊ฒ ํ์.
- ๐ ์ค์๊ฐ ๋ฐ์ดํฐ ์ง์: ์ค์๊ฐ์ผ๋ก ๋ค์ด์ค๋ ๋ฐ์ดํฐ๋ฅผ ์ฐจํธ์ ๋์ ์ผ๋ก ์ถ๊ฐํ๊ณ ์ ๋ฐ์ดํธ.
- ๐ ๋ฌดํ ์คํฌ๋กค: ์ฌ์ฉ์๊ฐ ์ฐจํธ ๋๊น์ง ์คํฌ๋กคํ๋ฉด Delegate๋ฅผ ํตํด ๊ณผ๊ฑฐ ๋๋ ๋ฏธ๋ ๋ฐ์ดํฐ๋ฅผ ๋น๋๊ธฐ์ ์ผ๋ก ๋ก๋.
- ๐งฌ ์ ์ฐํ ์ค๊ณ:
Date,Double๋ฟ๋ง ์๋๋ผChartableX๋ฅผ ์ค์ํ๋ ๋ชจ๋ ์ปค์คํ ํ์ ์ X์ถ์์ ์ฌ์ฉ ๊ฐ๋ฅ. - ๐ ์๋ฒฝํ ๋ฌธ์ํ: ๋ชจ๋ Public API์ ์์ธํ ์๋ฌธ/ํ๊ธ ์ฃผ์์ด ๋ฌ๋ ค์์ด ์ฌ์ฉ์ด ํธ๋ฆฌ.
- ๐ง ์์ฌ์ด ์ปค์คํฐ๋ง์ด์ง:
ChartConfiguration๊ฐ์ฒด๋ฅผ ํตํด ์ฐจํธ์ ์ธํ์ ์์ฝ๊ฒ ์ค์ .
| ๋ถ๋๋ฌ์ด ์ธํฐ๋์ (Pan & Zoom) | ์ค์๊ฐ ๋ฐ์ดํฐ ์ ๋ฐ์ดํธ (Real-time Update) | ์๋์ ์ธ ์ฑ๋ฅ (High Performance) |
|---|---|---|
| Line Chart | Area Chart | Bar Chart |
|---|---|---|
![]() |
![]() |
![]() |
ChartSwift-Kit์ Swift Package Manager๋ฅผ ํตํด ๊ฐํธํ๊ฒ ์ค์นํ ์ ์์ต๋๋ค.
- Xcode ํ๋ก์ ํธ์์ File > Add Packages... ๋ฅผ ์ ํํฉ๋๋ค.
- ์ค๋ฅธ์ชฝ ์๋จ์ ๊ฒ์์ฐฝ์ ์๋ Repository URL์ ๋ณต์ฌํ์ฌ ๋ถ์ฌ๋ฃ์ผ์ธ์.
https://github.com/PecanPiePOS/ChartSwift-Kit.git - Dependency Rule์์
Up to Next Major Version์ ์ ํํ๊ณ Add Package๋ฅผ ํด๋ฆญํฉ๋๋ค.
import ChartSwift_Kit
import UIKit
class ViewController: UIViewController {
let chartView = CoreChartView<Double>()
override func viewDidLoad() {
super.viewDidLoad()
let points = (0..<100).map {
ChartDataPoint(x: Double($0), y: Double.random(in: 0...100))
}
let series = ChartDataSeries(id: "sample", points: points, color: .systemCyan)
chartView.setData(series: [series], type: .line)
view.addSubview(chartView)
// ... Auto Layout ์ค์ ...
}
}ChartSwift-Kit is a high-performance iOS chart library designed to visualize large datasets smoothly and efficiently. The main component is CoreChartView, which provides an intuitive API for easy integration.
- ๐ Outstanding Performance: Handles tens of thousands of data points seamlessly with chunk-based rendering and LTTB downsampling.
- ๐จ Multiple Chart Types: Supports essential chart types, including Line, Bar, Area, and HealthData.
- ๐ Intuitive Gestures: Freely explore data by pinching to zoom and panning to scroll.
- ๐ Real-time Ready: Dynamically add and update data on the chart as it comes in real-time.
- ๐ Infinite Scroll: Asynchronously load past or future data via the delegate pattern when the user scrolls to the end.
- ๐งฌ Generic by Design: Use any custom type that conforms to
ChartableXfor the X-axis. - ๐ Thoroughly Documented: All public APIs are fully documented in both English and Korean.
- ๐ง Easily Customizable: Effortlessly configure the chart's appearance using
ChartConfiguration.
| Smooth Interaction (Pan & Zoom) | Real-time Updates | High Performance |
|---|---|---|
ChartSwift-Kit is available via the Swift Package Manager.
- In Xcode, select File > Add Packages....
- Copy and paste the repository URL below into the search bar:
https://github.com/PecanPiePOS/ChartSwift-Kit.git - Set the Dependency Rule to
Up to Next Major Versionand click Add Package.
import ChartSwift_Kit
import UIKit
class ViewController: UIViewController {
let chartView = CoreChartView<Double>()
override func viewDidLoad() {
super.viewDidLoad()
let points = (0..<100).map {
ChartDataPoint(x: Double($0), y: Double.random(in: 0...100))
}
let series = ChartDataSeries(id: "sample", points: points, color: .systemCyan)
chartView.setData(series: [series], type: .line)
view.addSubview(chartView)
// ... Set Auto Layout constraints ...
}
}Contributions of all kinds are welcome. Please feel free to open an issue or submit a PR.
ChartSwift-Kit is available under the Apache License 2.0. See the LICENSE file for more info.


