Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

Commit

Permalink
Update code to the newest version
Browse files Browse the repository at this point in the history
  • Loading branch information
denniscmcom committed Aug 9, 2021
1 parent 2e59f5e commit 6c2a9d8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 52 deletions.
22 changes: 6 additions & 16 deletions Trades/Details.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,14 @@ struct Details: View {
.fontWeight(.semibold)
.padding()

let data = randomDataManager.create()
let lineChartStyle = LineChartStyle(
labelColor: Color(.systemBlue),
indicatorPointColor: Color(.systemTeal),
showingIndicatorLineColor: Color(.systemBlue),
flatTrendLineColor: Color(.systemTeal),
uptrendLineColor: Color(.systemGreen),
downtrendLineColor: Color(.systemRed)
)

LineChartView(
data: data,
dates: nil,
hours: nil,
dragGesture: true,
style: lineChartStyle
lineChartController:
LineChartController(
prices: randomDataManager.create(),
dragGesture: true
)
)
.padding(.bottom)
.padding(.bottom)
}
,alignment: .leading
)
Expand Down
21 changes: 3 additions & 18 deletions Trades/Helpers/Company.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,9 @@ struct Company: View {

Spacer()

let data = randomDataManager.create()
let lineChartStyle = LineChartStyle(
labelColor: Color(.systemBlue),
indicatorPointColor: Color(.systemTeal),
showingIndicatorLineColor: Color(.systemBlue),
flatTrendLineColor: Color(.systemTeal),
uptrendLineColor: Color(.systemGreen),
downtrendLineColor: Color(.systemRed)
)

LineChartView(
data: data,
dates: nil,
hours: nil,
dragGesture: false,
style: lineChartStyle
)
.padding(.bottom, 5)
let prices = randomDataManager.create()
LineChartView(lineChartController: LineChartController(prices: prices))
.padding(.bottom, 5)
}
, alignment: .leading
)
Expand Down
21 changes: 3 additions & 18 deletions Trades/Popular.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,11 @@ struct Popular: View {
}
.padding(.trailing)

let data = randomDataManager.create()
let lineChartStyle = LineChartStyle(
labelColor: Color(.systemBlue),
indicatorPointColor: Color(.systemTeal),
showingIndicatorLineColor: Color(.systemBlue),
flatTrendLineColor: Color(.systemTeal),
uptrendLineColor: Color(.systemGreen),
downtrendLineColor: Color(.systemRed)
)

Spacer()

LineChartView(
data: data,
dates: nil,
hours: nil,
dragGesture: false,
style: lineChartStyle
)
.frame(width: 150)
let prices = randomDataManager.create()
LineChartView(lineChartController: LineChartController(prices: prices))
.frame(width: 150)

Text("\(company.price, specifier: "%.2f")")
.fontWeight(.semibold)
Expand Down

0 comments on commit 6c2a9d8

Please sign in to comment.