Closed gesabo closed 2 years ago
This should be fixed in v2.9.9.
Thanks
@gesabo I am working on fixing this issue after including the reverted fix. I am not able to repro this issue with MutliLineChart. Can you please share the code you used to create this chart? In specific, I want to understand which chart type you are using.
@sai-manoj-kumar after checking my code I realized I was actually adding my own custom "legend" for the word Trend in the screenshot, so whatever changed in version 2.9.8 somehow made my Text view overlap the chart:
VStack(alignment: .leading, spacing: -20) {
BarChart(chartData: unwrappedData)
.extraLine(chartData: unwrappedData, legendTitle: "") {
makeTrendData(data: athlyticDataStore.past60DaysOr6MonthsRecoveryScoreObjects?.suffix(60).compactMap { Double($0.recoveryScore)})
} style: {
showWeeklyAverageChart ? extraLineHiddenStyle : extraLineStyle
}
.touchOverlay(chartData: unwrappedData) //to be able to tab to see points need both .touchOverlay and .floatingInfoBox
.floatingInfoBox(chartData: unwrappedData)
.xAxisLabels(chartData: unwrappedData)
.yAxisLabels(chartData: unwrappedData)
.id(unwrappedData.id)
.animation(nil) //this prevents any of the chart from animating
.unredacted()
if !showWeeklyAverageChart {
if makeTrendData(data: athlyticDataStore.past60DaysOr6MonthsRecoveryScoreObjects?.suffix(60).compactMap { Double($0.recoveryScore)}).count > 1 {
HStack {
RoundedRectangle(cornerRadius: 2.0)
.foregroundColor( colorScheme == .dark ? Color(.label) : TrackerConstants.trendLineColor)
.frame(width: 8.0, height: 8.0)
Text("Trend")
.font(.footnote)
.unredacted()
}
}
}
}
@gesabo, Thanks for sharing the code. I think it is happening because of the spacing of -20 in your VStack. I was able to repro the issue along with the PR. After removing the spacing: -20, the issue is gone. Please confirm if this works or not.
@sai-manoj-kumar thank you yes it seems like removing spacing of -20 solves the issue using version 2.9.8 and 2.9.9 as well. 👍
@gesabo Thanks for confirming it quickly.
@willdale Can you please revert the reverted PR again? Thanks
I'm not sure if its just me or the cause but this same chart which looked fine in 2.9.7, now in 2.9.8 the Legend (the word "Trend") is overlapping the xAxis values, see below, 2.9.7 is on the bottom.