# HG changeset patch # User Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com> # Date 1622995687 -7200 # Node ID b9aa9d7b030dd0f0e3ce885508fa34537567f7dc # Parent d5dc68b6d459e06013375d81a78316a1fc397237 Handle input data when is empty diff -r d5dc68b6d459 -r b9aa9d7b030d Sources/StockCharts/LineChart/LineChartView.swift --- a/Sources/StockCharts/LineChart/LineChartView.swift Sat Jun 05 18:50:36 2021 +0200 +++ b/Sources/StockCharts/LineChart/LineChartView.swift Sun Jun 06 18:08:07 2021 +0200 @@ -24,14 +24,16 @@ } public var body: some View { - VStack { - if dragGesture ?? true { - ChartLabel(data: data, dates: dates, hours: hours, indexPosition: $indexPosition) - .opacity(showingIndicators ? 1: 0) - .padding(.vertical) + if !data.isEmpty { + VStack { + if dragGesture ?? true { + 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) } - - LineView(data: data, dates: dates, hours: hours, dragGesture: dragGesture, showingIndicators: $showingIndicators, indexPosition: $indexPosition) } } } diff -r d5dc68b6d459 -r b9aa9d7b030d StockCharts.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate Binary file StockCharts.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate has changed