From af66d83f9bbc2ca3c3674cf7ceb35073210c3fd3 Mon Sep 17 00:00:00 2001 From: hackerESQ Date: Tue, 6 Aug 2024 23:12:57 -0500 Subject: [PATCH] add reset line chart option --- .../views/components/ib-apex-chart.blade.php | 18 +++++++---- .../portfolio-performance-cards.blade.php | 31 ++++++++++--------- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/resources/views/components/ib-apex-chart.blade.php b/resources/views/components/ib-apex-chart.blade.php index cf31202..a197862 100644 --- a/resources/views/components/ib-apex-chart.blade.php +++ b/resources/views/components/ib-apex-chart.blade.php @@ -82,12 +82,10 @@ this.data.chart.events = { mounted: function (chartContext, config) { - console.log('moount', chartContext) - renderCustomLegend(chartContext); + renderLegend(chartContext); }, updated: function (chartContext, config) { - console.log('update') - renderCustomLegend(chartContext); + renderLegend(chartContext); } } @@ -95,7 +93,15 @@ chart.render(); - function renderCustomLegend(chartContext) { + // reset custom zoom button + var resetZoomButton = document.querySelector('#chart-reset-zoom-{{ $name }}'); + resetZoomButton.addEventListener('click', function () { + chart.resetSeries() + + }); + + // generate custom legend view + function renderLegend(chartContext) { var legendContainer = document.querySelector('#chart-legend-{{ $name }}'); if (!legendContainer) return; @@ -146,6 +152,6 @@ } }" > -
+
diff --git a/resources/views/livewire/portfolio-performance-cards.blade.php b/resources/views/livewire/portfolio-performance-cards.blade.php index 2c9b336..7702ff6 100644 --- a/resources/views/livewire/portfolio-performance-cards.blade.php +++ b/resources/views/livewire/portfolio-performance-cards.blade.php @@ -88,21 +88,24 @@ new class extends Component {
- - - - - @foreach($options as $option) - - - - @endforeach - - +
+ + + + + + @foreach($options as $option) + + + + @endforeach + + +