I have a LiveView set up nicely with a chart (from Highcharts) showing some data. The chart is enclosed in a div with the phx-update="ignore"
attribute which works great. However, moving away from the current LiveView and coming back to it makes the chart disappear.
dashboard_live.html.leex:
<div phx-update="ignore" id="custom-chart">
<figure id="main-chart" class="highcharts-figure">
<div class="chart-container" id="<%= @chart_id %>"></div>
</figure>
<script id="main-chart-data">
</script>
</div>
When I initially visit the page, I see the chart as expected:
After I click on a live_patch
or live_redirect
link to go to a different page, and then click on the dashboard link again to come back to the dashboard page, I see this:
It shows back normally when I refresh the page.
Any ideas how this could be solved?
Thanks a lot.