diff --git a/Sources/StockCharts/LineChart/LineChartView.swift b/Sources/StockCharts/LineChart/LineChartView.swift index aedab37..9f5b04e 100644 --- a/Sources/StockCharts/LineChart/LineChartView.swift +++ b/Sources/StockCharts/LineChart/LineChartView.swift @@ -24,14 +24,16 @@ public struct LineChartView: View { } 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 --git a/StockCharts.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate b/StockCharts.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate index e31620b..5550010 100644 Binary files a/StockCharts.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate and b/StockCharts.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate differ