comparison Sources/StockCharts/LineChart/LineChartView.swift @ 91:b9aa9d7b030d

Handle input data when is empty
author Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
date Sun, 06 Jun 2021 18:08:07 +0200
parents 34844d649ed7
children 46e874c1f459
comparison
equal deleted inserted replaced
90:d5dc68b6d459 91:b9aa9d7b030d
22 self.hours = hours 22 self.hours = hours
23 self.dragGesture = dragGesture 23 self.dragGesture = dragGesture
24 } 24 }
25 25
26 public var body: some View { 26 public var body: some View {
27 VStack { 27 if !data.isEmpty {
28 if dragGesture ?? true { 28 VStack {
29 ChartLabel(data: data, dates: dates, hours: hours, indexPosition: $indexPosition) 29 if dragGesture ?? true {
30 .opacity(showingIndicators ? 1: 0) 30 ChartLabel(data: data, dates: dates, hours: hours, indexPosition: $indexPosition)
31 .padding(.vertical) 31 .opacity(showingIndicators ? 1: 0)
32 .padding(.vertical)
33 }
34
35 LineView(data: data, dates: dates, hours: hours, dragGesture: dragGesture, showingIndicators: $showingIndicators, indexPosition: $indexPosition)
32 } 36 }
33
34 LineView(data: data, dates: dates, hours: hours, dragGesture: dragGesture, showingIndicators: $showingIndicators, indexPosition: $indexPosition)
35 } 37 }
36 } 38 }
37 } 39 }