From d449a89349f46237dba766e61cfb50889503e171 Mon Sep 17 00:00:00 2001 From: hackerESQ Date: Fri, 20 Mar 2026 20:51:19 -0500 Subject: [PATCH] Show only market gain on performance chart (#190) (by default) Allow other options as a choice --- resources/views/components/ui/apex-chart.blade.php | 1 + .../portfolio/portfolio-performance-chart.blade.php | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/resources/views/components/ui/apex-chart.blade.php b/resources/views/components/ui/apex-chart.blade.php index fa73c1d..be3129d 100644 --- a/resources/views/components/ui/apex-chart.blade.php +++ b/resources/views/components/ui/apex-chart.blade.php @@ -99,6 +99,7 @@ this.data.tooltip = { enabled: true, + shared: false, y: { formatter: (value, { series, seriesIndex, dataPointIndex, w }) => { const firstDataPoint = this.data.series[seriesIndex].data[0][1] diff --git a/resources/views/portfolio/portfolio-performance-chart.blade.php b/resources/views/portfolio/portfolio-performance-chart.blade.php index fb0ffe6..5845f25 100644 --- a/resources/views/portfolio/portfolio-performance-chart.blade.php +++ b/resources/views/portfolio/portfolio-performance-chart.blade.php @@ -75,26 +75,29 @@ new #[Lazy] class extends Component foreach ($dailyChange as $data) { $date = $data->date; + $marketGainData[] = [$date, round($data->total_market_gain, 2)]; $marketValueData[] = [$date, round($data->total_market_value, 2)]; $costBasisData[] = [$date, round($data->total_cost_basis, 2)]; - $marketGainData[] = [$date, round($data->total_market_gain, 2)]; + // $dividendSeries[] = [$date, round($data->total_dividends_earned, 2)]; // $realizedGainSeries[] = [$date, round($data->realized_gains, 2)]; } return [ 'series' => [ + [ + 'name' => __('Market Gain'), + 'data' => $marketGainData, + ], [ 'name' => __('Market Value'), 'data' => $marketValueData, + 'hidden' => true, ], [ 'name' => __('Cost Basis'), 'data' => $costBasisData, - ], - [ - 'name' => __('Market Gain'), - 'data' => $marketGainData, + 'hidden' => true, ], // [