Mercurial > public > stock-charts
view Sources/StockCharts/LineChart/LineChartView.swift @ 63:fdc4db7f23de 0.0.1 0.0.2 1.0.0 1.1.0 v1.1
Merge pull request #5 from denniscm190/denniscm190
Denniscm190
committer: GitHub <noreply@github.com>
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Fri, 07 May 2021 12:28:56 +0200 |
parents | Sources/StockCharts/LineChart/ChartView.swift@48fe101fd122 Sources/StockCharts/LineChart/ChartView.swift@d689500c785e |
children | 1a5b4d95e068 |
line wrap: on
line source
// // LineChartView.swift // StockCharts // // Created by Dennis Concepción Martín on 30/4/21. // import SwiftUI public struct LineChartView: View { public var data: [Double] public var dates: [String]? public var hours: [String]? public var dragGesture: Bool? @State var showingIndicators = false @State var indexPosition = Int() public init(data: [Double], dates: [String]?, hours: [String]?, dragGesture: Bool?) { self.data = data self.dates = dates self.hours = hours self.dragGesture = dragGesture } public var body: some View { VStack { ChartLabel(data: data, dates: dates, hours: hours, indexPosition: $indexPosition) .opacity(showingIndicators ? 1: 0) .padding(.vertical) LineView(data: data, dates: dates, hours: hours, dragGesture: dragGesture, showingIndicators: $showingIndicators, indexPosition: $indexPosition) } } }