Skip to content

High-performance, interactive Swift charts for iOS. Handles large datasets with pan, zoom, and real-time updates.

License

Notifications You must be signed in to change notification settings

PecanPiePOS/ChartSwift-Kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

14 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation


ChartSwift-Kit


A powerful and lightweight charting library for iOS featuring CoreChartView.
Designed for performance, flexibility, and ease of use.


๐Ÿ‡ฐ๐Ÿ‡ท ํ•œ๊ตญ์–ด | ๐Ÿ‡บ๐Ÿ‡ธ English

SwiftPM compatible Platform Swift Version License

๐Ÿ‡ฐ๐Ÿ‡ท ํ•œ๊ตญ์–ด

ChartSwift-Kit์€ ๋Œ€์šฉ๋Ÿ‰ ๋ฐ์ดํ„ฐ๋ฅผ ๋น ๋ฅด๊ณ  ๋ถ€๋“œ๋Ÿฝ๊ฒŒ ์‹œ๊ฐํ™”ํ•˜๊ธฐ ์œ„ํ•ด ์„ค๊ณ„๋œ ๊ณ ์„ฑ๋Šฅ iOS ์ฐจํŠธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์ž…๋‹ˆ๋‹ค. ์ด ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์˜ ๋ฉ”์ธ ์ปดํฌ๋„ŒํŠธ๋Š” **CoreChartView**์ด๋ฉฐ, ์ง๊ด€์ ์ธ API์™€ ๊ฐ•๋ ฅํ•œ ์ปค์Šคํ„ฐ๋งˆ์ด์ง• ์˜ต์…˜์„ ์ œ๊ณตํ•˜์—ฌ ์–ด๋–ค iOS ์•ฑ์—๋„ ์‰ฝ๊ฒŒ ํ†ตํ•ฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

โœจ ์ฃผ์š” ๊ธฐ๋Šฅ (Features)

  • ๐Ÿš€ ์••๋„์ ์ธ ์„ฑ๋Šฅ: ์ˆ˜๋งŒ ๊ฐœ์˜ ๋ฐ์ดํ„ฐ ํฌ์ธํŠธ๋„ ๋Š๊น€ ์—†์ด ์ฒ˜๋ฆฌํ•˜๋Š” ์ฒญํฌ ๊ธฐ๋ฐ˜ ๋ Œ๋”๋ง ๋ฐ LTTB ๋‹ค์šด์ƒ˜ํ”Œ๋ง.
  • ๐ŸŽจ ๋‹ค์–‘ํ•œ ์ฐจํŠธ ํƒ€์ž…: ๋ผ์ธ(Line), ๋ฐ”(Bar), ์˜์—ญ(Area), ํ—ฌ์Šค ๋ฐ์ดํ„ฐ(HealthData) ๋“ฑ ํ•„์ˆ˜ ์ฐจํŠธ ํƒ€์ž…์„ ๋ชจ๋‘ ์ง€์›.
  • ๐Ÿ‘† ์ง๊ด€์ ์ธ ์ œ์Šค์ฒ˜: ํ•€์น˜(Pinch)๋กœ ํ™•๋Œ€/์ถ•์†Œํ•˜๊ณ , ํŒฌ(Pan)์œผ๋กœ ์Šคํฌ๋กคํ•˜๋ฉฐ ๋ฐ์ดํ„ฐ๋ฅผ ์ž์œ ๋กญ๊ฒŒ ํƒ์ƒ‰.
  • ๐Ÿ•’ ์‹ค์‹œ๊ฐ„ ๋ฐ์ดํ„ฐ ์ง€์›: ์‹ค์‹œ๊ฐ„์œผ๋กœ ๋“ค์–ด์˜ค๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ์ฐจํŠธ์— ๋™์ ์œผ๋กœ ์ถ”๊ฐ€ํ•˜๊ณ  ์—…๋ฐ์ดํŠธ.
  • ๐Ÿ“œ ๋ฌดํ•œ ์Šคํฌ๋กค: ์‚ฌ์šฉ์ž๊ฐ€ ์ฐจํŠธ ๋๊นŒ์ง€ ์Šคํฌ๋กคํ•˜๋ฉด Delegate๋ฅผ ํ†ตํ•ด ๊ณผ๊ฑฐ ๋˜๋Š” ๋ฏธ๋ž˜ ๋ฐ์ดํ„ฐ๋ฅผ ๋น„๋™๊ธฐ์ ์œผ๋กœ ๋กœ๋“œ.
  • ๐Ÿงฌ ์œ ์—ฐํ•œ ์„ค๊ณ„: Date, Double ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ ChartableX๋ฅผ ์ค€์ˆ˜ํ•˜๋Š” ๋ชจ๋“  ์ปค์Šคํ…€ ํƒ€์ž…์„ X์ถ•์—์„œ ์‚ฌ์šฉ ๊ฐ€๋Šฅ.
  • ๐Ÿ“š ์™„๋ฒฝํ•œ ๋ฌธ์„œํ™”: ๋ชจ๋“  Public API์— ์ƒ์„ธํ•œ ์˜๋ฌธ/ํ•œ๊ธ€ ์ฃผ์„์ด ๋‹ฌ๋ ค์žˆ์–ด ์‚ฌ์šฉ์ด ํŽธ๋ฆฌ.
  • ๐Ÿ”ง ์†์‰ฌ์šด ์ปค์Šคํ„ฐ๋งˆ์ด์ง•: ChartConfiguration ๊ฐ์ฒด๋ฅผ ํ†ตํ•ด ์ฐจํŠธ์˜ ์™ธํ˜•์„ ์†์‰ฝ๊ฒŒ ์„ค์ •.

๐ŸŽฌ ์ฃผ์š” ๊ธฐ๋Šฅ ๋ฐ๋ชจ (GIF)

๋ถ€๋“œ๋Ÿฌ์šด ์ธํ„ฐ๋ž™์…˜ (Pan & Zoom) ์‹ค์‹œ๊ฐ„ ๋ฐ์ดํ„ฐ ์—…๋ฐ์ดํŠธ (Real-time Update) ์••๋„์ ์ธ ์„ฑ๋Šฅ (High Performance)
Pan and Zoom Demo GIF Real-time Demo GIF Performance Test Demo GIF

Line Chart Area Chart Bar Chart
Line Chart Example Area Chart Example Bar Chart Example


๐Ÿ“ฆ ์„ค์น˜ (Installation)

ChartSwift-Kit์€ Swift Package Manager๋ฅผ ํ†ตํ•ด ๊ฐ„ํŽธํ•˜๊ฒŒ ์„ค์น˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  1. Xcode ํ”„๋กœ์ ํŠธ์—์„œ File > Add Packages... ๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  2. ์˜ค๋ฅธ์ชฝ ์ƒ๋‹จ์˜ ๊ฒ€์ƒ‰์ฐฝ์— ์•„๋ž˜ Repository URL์„ ๋ณต์‚ฌํ•˜์—ฌ ๋ถ™์—ฌ๋„ฃ์œผ์„ธ์š”.
    https://github.com/PecanPiePOS/ChartSwift-Kit.git
    
  3. Dependency Rule์—์„œ Up to Next Major Version์„ ์„ ํƒํ•˜๊ณ  Add Package๋ฅผ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

๐Ÿš€ ๋น ๋ฅธ ์‹œ์ž‘ (Quick Start)

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 ์„ค์ • ...
    }
}



๐Ÿ‡บ๐Ÿ‡ธ English

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.

โœจ Features

  • ๐Ÿš€ 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 ChartableX for 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.

๐ŸŽฌ Key Feature Demos (GIFs)

Smooth Interaction (Pan & Zoom) Real-time Updates High Performance
Pan and Zoom Demo GIF Real-time Demo GIF Performance Test Demo GIF

๐Ÿ“ฆ Installation

ChartSwift-Kit is available via the Swift Package Manager.

  1. In Xcode, select File > Add Packages....
  2. Copy and paste the repository URL below into the search bar:
    https://github.com/PecanPiePOS/ChartSwift-Kit.git
    
  3. Set the Dependency Rule to Up to Next Major Version and click Add Package.

๐Ÿš€ Quick Start

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 ...
    }
}

๐Ÿค Contributing

Contributions of all kinds are welcome. Please feel free to open an issue or submit a PR.

๐Ÿ“„ License

ChartSwift-Kit is available under the Apache License 2.0. See the LICENSE file for more info.

About

High-performance, interactive Swift charts for iOS. Handles large datasets with pan, zoom, and real-time updates.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages