Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

Commit

Permalink
Merge pull request #9 from denniscm190/dennis
Browse files Browse the repository at this point in the history
Handle input data when is empty
  • Loading branch information
denniscmcom committed Jun 6, 2021
2 parents 9f561a3 + af54329 commit 92c4eea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Sources/StockCharts/LineChart/LineChartView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
}
Binary file not shown.

0 comments on commit 92c4eea

Please sign in to comment.