https://github.com/wadie-ess/contributionchartview
SwfitUI Package for Contribution Chart View Inspired by Github and LeetCode
https://github.com/wadie-ess/contributionchartview
contributionchart package package-manager swift swift-package-manager swiftui swiftui-charts swiftui-components swiftui-example swiftui-framework
Last synced: 3 months ago
JSON representation
SwfitUI Package for Contribution Chart View Inspired by Github and LeetCode
- Host: GitHub
- URL: https://github.com/wadie-ess/contributionchartview
- Owner: Wadie-ess
- Created: 2023-06-10T09:10:14.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-15T13:38:45.000Z (about 3 years ago)
- Last Synced: 2025-09-16T18:22:27.745Z (9 months ago)
- Topics: contributionchart, package, package-manager, swift, swift-package-manager, swiftui, swiftui-charts, swiftui-components, swiftui-example, swiftui-framework
- Language: Swift
- Homepage:
- Size: 14.3 MB
- Stars: 29
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SwiftUI ContributionChartView

Contribution Chart View is a SwiftUI package that provides a customizable chart view to display contributions over a period of time, similar to GitHub's contribution chart.

[](https://swiftpackageindex.com/exyte/ActivityIndicatorView)
[](https://swiftpackageindex.com/exyte/ActivityIndicatorView)
[](https://swiftpackageindex.com/exyte/ActivityIndicatorView)
[](https://cocoapods.org/pods/ActivityIndicatorView)
[](https://github.com/Carthage/Carthage)
[](https://opensource.org/licenses/MIT)
## Features
- Visualize contributions with customizable colors.
- Adjustable number of days per row.
- Support for total days.
## Requirements
- iOS 13.0+ / macOS 10.15+
- Xcode 11.0+
- Swift 5.0+
## Installation
- Clone the repository:
- Open your Xcode project.
- Drag the ContributionChartView folder from Finder into your Xcode project.
- Ensure that the files are added to the appropriate target(s) in your project.
## Usage
- Import the module:
``` swift
import GithubSwiftCharts
```
- Create an instance of ContributionChartView:
``` swift
let contributionData = [
"2023-06-01": 4,
"2023-06-02": 2,
"2023-06-03": 9,
// Add your contribution data here
]
let daysPerRow = 23
let totalDays = 90
let chartView = ContributionChartView(contributionData: contributionData, daysPerRow: daysPerRow, totalDays: totalDays)
```
- Use chartView in your SwiftUI view hierarchy:
``` swift
struct ContentView: View {
var body: some View {
VStack {
// Your other views
chartView
// Your other views
}
}
}
```
### Swift Package Manager
You can use the Swift Package Manager to install ContributionChartView by adding it as a dependency in your `Package.swift` file:
```swift
.package(url: "https://github.com/your-username/ContributionChartView.git", from: "1.0.0")
```
## License
Feel free to use or to share this package as you want!