* Add ColorGradient example Add ColorGradient single color constructor Add preview for BarChart * Add PieChart Allow multi color for Pie and Bar Add linter
29 lines
921 B
Swift
29 lines
921 B
Swift
import SwiftUI
|
|
|
|
public struct ChartStyle {
|
|
|
|
public let backgroundColor: ColorGradient
|
|
public let foregroundColor: [ColorGradient]
|
|
|
|
public init(backgroundColor: Color, foregroundColor: [ColorGradient]) {
|
|
self.backgroundColor = ColorGradient.init(backgroundColor)
|
|
self.foregroundColor = foregroundColor
|
|
}
|
|
|
|
public init(backgroundColor: Color, foregroundColor: ColorGradient) {
|
|
self.backgroundColor = ColorGradient.init(backgroundColor)
|
|
self.foregroundColor = [foregroundColor]
|
|
}
|
|
|
|
public init(backgroundColor: ColorGradient, foregroundColor: ColorGradient) {
|
|
self.backgroundColor = backgroundColor
|
|
self.foregroundColor = [foregroundColor]
|
|
}
|
|
|
|
public init(backgroundColor: ColorGradient, foregroundColor: [ColorGradient]) {
|
|
self.backgroundColor = backgroundColor
|
|
self.foregroundColor = foregroundColor
|
|
}
|
|
|
|
}
|