File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import Charts
66struct StatsChartView : View {
77
88 @Binding public var transferData : [ TransferInfo ]
9+ public var color : Color = . blue
910
1011 var body : some View {
1112 VStack {
@@ -19,7 +20,7 @@ struct StatsChartView: View {
1920 . mask { RectangleMark ( ) }
2021 . foregroundStyle (
2122 LinearGradient (
22- gradient: Gradient ( colors: [ . blue . opacity ( 0.4 ) , . blue . opacity ( 0.2 ) ] ) ,
23+ gradient: Gradient ( colors: [ self . color . opacity ( 0.4 ) , self . color . opacity ( 0.2 ) ] ) ,
2324 startPoint: . top,
2425 endPoint: . bottom
2526 )
@@ -30,7 +31,7 @@ struct StatsChartView: View {
3031 y: . value( " Transfer " , transferData. info_speed)
3132 ) . interpolationMethod ( . monotone)
3233 . mask { RectangleMark ( ) }
33- . foregroundStyle ( . blue )
34+ . foregroundStyle ( self . color )
3435 } . chartXScale ( domain: - 30 ... 0 )
3536 . chartYAxis {
3637 AxisMarks {
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ struct StatsView: View {
1616 Section ( header: Text ( " Download " ) ) {
1717 CustomLabelView ( label: " Session Download " , value: " \( qBittorrent. getFormatedSize ( size: qBitDataShared. serverState? . dl_info_data ?? 0 ) ) " )
1818 CustomLabelView ( label: " Download Speed " , value: " \( qBittorrent. getFormatedSize ( size: qBitDataShared. serverState? . dl_info_speed ?? 0 ) ) /s " )
19- StatsChartView ( transferData: $qBitDataShared. dlTransferData)
19+ StatsChartView ( transferData: $qBitDataShared. dlTransferData, color : . green )
2020 }
2121
2222 Section ( header: Text ( " Upload " ) ) {
You can’t perform that action at this time.
0 commit comments