Dashboard: quitar títulos duplicados en cards de gráficas (build 81) #33

showsTitle (default true) en HorizontalPerformanceChart, DrawdownChart,
VolatilityChartView, PredictionChartView y YearOverYearChartView; el
pageContent del Dashboard pasa false porque el header de la card ya nombra
la página. La sección Charts no cambia.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L38583J7AYWCVPevkivscj
This commit is contained in:
alexandrev-tibco
2026-08-06 22:55:27 +02:00
parent cf984dbf09
commit 6e6f4c5489
6 changed files with 50 additions and 27 deletions
@@ -185,6 +185,8 @@ struct PerformanceBarChart: View {
struct HorizontalPerformanceChart: View {
let data: [(category: String, cagr: Double, color: String)]
/// Hidden when the host (e.g. a dashboard card) already shows a title.
var showsTitle: Bool = true
var sortedData: [(category: String, cagr: Double, color: String)] {
data.sorted { $0.cagr > $1.cagr }
@@ -196,8 +198,10 @@ struct HorizontalPerformanceChart: View {
var body: some View {
VStack(alignment: .leading, spacing: 16) {
Text("Performance by Category")
.font(.headline)
if showsTitle {
Text("Performance by Category")
.font(.headline)
}
ForEach(sortedData, id: \.category) { item in
VStack(alignment: .leading, spacing: 4) {