# HG changeset patch # User Dennis C. M. # Date 1622995865 -7200 # Node ID 2932cb8bcee3c0e10e5a62dc6c50f69dcb28f416 # Parent 5b9859e47d3c29b213268b91de88a7e012f4192c# Parent b9aa9d7b030dd0f0e3ce885508fa34537567f7dc Merge pull request #9 from denniscm190/dennis Handle input data when is empty committer: GitHub diff -r 5b9859e47d3c -r 2932cb8bcee3 Sources/StockCharts/LineChart/LineChartView.swift --- a/Sources/StockCharts/LineChart/LineChartView.swift Sat Jun 05 18:58:16 2021 +0200 +++ b/Sources/StockCharts/LineChart/LineChartView.swift Sun Jun 06 18:11:05 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 5b9859e47d3c -r 2932cb8bcee3 StockCharts.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate Binary file StockCharts.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate has changed