项目
在 GitHub 查看
spacenation/swiftui-charts
关于
:rocket: 支持自定义样式的 SwiftUI 图表
数据与分析实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- -1
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文SwiftUI Charts
Build custom charts with SwiftUI
Styles
Line
Chart(data: [0.1, 0.3, 0.2, 0.5, 0.4, 0.9, 0.1])
.chartStyle(
LineChartStyle(.quadCurve, lineColor: .blue, lineWidth: 5)
)
Area
Chart(data: [0.1, 0.3, 0.2, 0.5, 0.4, 0.9, 0.1])
.chartStyle(
AreaChartStyle(.quadCurve, fill:
LinearGradient(gradient: .init(colors: [Color.blue.opacity(0.2), Color.blue.opacity(0.05)]), startPoint: .top, endPoint: .bottom)
)
)
Stacked Area
Chart(data: matrix)
.chartStyle(
StackedAreaChartStyle(.quadCurve, colors: [.yellow, .orange, .red])
)
Column
Chart(data: [0.1, 0.3, 0.2, 0.5, 0.4, 0.9, 0.1])
.chartStyle(
ColumnChartStyle(column: Capsule().foregroundColor(.green), spacing: 2)
)
Stacked Column
Chart(data: matrix)
.chartStyle(
StackedColumnChartStyle(spacing: 2, cornerRadius: 3, colors: [.yellow, .orange, .red])
)
Install
Add Charts to your project with Swift Package Manager
// swift-tools-version:5.1
import PackageDescription
let package = Package(
name: "YOUR_PROJECT",
dependencies: [
.package(url: "https://github.com/spacenation/swiftui-charts.git", from: "1.0.0"),
]
)
Roadmap
- Bar chart style
Code Contributions
Feel free to contribute via fork/pull request to master branch. If you want to request a feature or report a bug please start a new issue.
探索相关项目
加载中…