Add 3 interactive chart types: Compare, What If, Period vs Period (build 34)

- Compare (free): multi-source overlay chart, Base 100 / Return % / Value modes,
  chip selector, reactive to time range filter
- What If (premium): allocation simulator with sliders per source, dual-line chart
  actual vs simulated indexed to 100, orange warning when weights ≠ 100%
- Period vs Period (free): date-picker-driven comparison of any two custom periods,
  return % normalized from month 1 = 0%, color-coded legend with period labels

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
alexandrev-tibco
2026-05-26 15:32:57 +02:00
parent 270edeb536
commit 12ab2d6009
6 changed files with 1125 additions and 12 deletions
@@ -192,6 +192,10 @@ struct ChartsContainerView: View {
private var hasAnyFilter: Bool {
let chartType = viewModel.selectedChartType
// These chart types manage their own controls internally, no external filter bar needed
if chartType == .comparison || chartType == .simulator || chartType == .periodComparison {
return !viewModel.availableTimeRanges(for: chartType).isEmpty
}
let hasTimeRange = chartType != .allocation && chartType != .riskReturn
let hasCategories = !viewModel.availableCategories(for: chartType).isEmpty
let hasSources = !viewModel.availableSources(for: chartType).isEmpty
@@ -498,6 +502,12 @@ struct ChartsContainerView: View {
)
case .yearOverYear:
YearOverYearChartView(series: viewModel.yearOverYearData)
case .comparison:
ComparisonChartView(viewModel: viewModel)
case .simulator:
AllocationSimulatorView(viewModel: viewModel)
case .periodComparison:
PeriodComparisonChartView(viewModel: viewModel)
}
}
}