From 367fd7802b5882c2ed754289f7223491a233659d Mon Sep 17 00:00:00 2001 From: hackerESQ Date: Fri, 27 Sep 2024 10:51:43 -0500 Subject: [PATCH] fix:order of data series --- resources/views/components/ib-apex-chart.blade.php | 3 +-- resources/views/livewire/portfolio-performance-chart.blade.php | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/resources/views/components/ib-apex-chart.blade.php b/resources/views/components/ib-apex-chart.blade.php index 2d4b0eb..b3b7ea3 100644 --- a/resources/views/components/ib-apex-chart.blade.php +++ b/resources/views/components/ib-apex-chart.blade.php @@ -101,7 +101,6 @@ enabled: true, y: { formatter: (value, { series, seriesIndex, dataPointIndex, w }) => { - const firstDataPoint = this.data.series[seriesIndex].data[0][1] const percentageChange = ((value - firstDataPoint) / firstDataPoint) * 100; return `$${parseFloat(value.toFixed(2))} (${percentageChange.toFixed(2)}%)`; @@ -121,7 +120,7 @@ // generate custom legend view function renderLegend(chartContext) { - console.log(chartContext) + var legendContainer = document.querySelector('#chart-legend-{{ $name }}'); if (!legendContainer) return; diff --git a/resources/views/livewire/portfolio-performance-chart.blade.php b/resources/views/livewire/portfolio-performance-chart.blade.php index 492a783..3d65119 100644 --- a/resources/views/livewire/portfolio-performance-chart.blade.php +++ b/resources/views/livewire/portfolio-performance-chart.blade.php @@ -51,8 +51,7 @@ new class extends Component { SUM(total_dividends_earned) as total_dividends_earned */ ') - ->groupBy('date') - ->orderByDesc('date'); + ->groupBy('date'); }