allow click legend after update chart

This commit is contained in:
hackerESQ
2024-08-27 22:53:57 -05:00
parent 1ee6a5c17b
commit 8a136fe1d7
2 changed files with 4 additions and 2 deletions
@@ -88,9 +88,9 @@
mounted: function (chartContext, config) { mounted: function (chartContext, config) {
renderLegend(chartContext); renderLegend(chartContext);
}, },
updated: function (chartContext, config) { {{-- updated: function (chartContext, config) {
renderLegend(chartContext); renderLegend(chartContext);
} } --}}
} }
this.data.tooltip = { this.data.tooltip = {
@@ -117,6 +117,7 @@
// generate custom legend view // generate custom legend view
function renderLegend(chartContext) { function renderLegend(chartContext) {
console.log(chartContext)
var legendContainer = document.querySelector('#chart-legend-{{ $name }}'); var legendContainer = document.querySelector('#chart-legend-{{ $name }}');
if (!legendContainer) return; if (!legendContainer) return;
@@ -36,6 +36,7 @@ new class extends Component {
$dailyChangeQuery = DailyChange::query(); $dailyChangeQuery = DailyChange::query();
if (isset($this->portfolio)) { if (isset($this->portfolio)) {
$dailyChangeQuery->portfolio($this->portfolio->id); $dailyChangeQuery->portfolio($this->portfolio->id);
} else { } else {