amcharts4
amcharts4 copied to clipboard
Is it possible to not instantiate a chart until it is visible?
Hello,
I have a problem with amcharts4 graphics in a dashboard. The dashboard has several pages and there is one chart in each page. When opening it, the chart at the first page is correct. But when going to another page, the chart on this page is already rendered and not correctly. Therefore I'm looking for an option like onlyShowOnViewport
but to not instantiate the chart when it is not visible (onlyShowWhenVisible
). I tried this option but it didn't help. I'm using the latest version of amcharts4 with React.
If you render a chart into a div with display:none and later change it to display:block, it should work fine.
Hello,
That's what I do in my answer on StackOverflow. This is nice except that the button is misplaced.
Try to call chart.zoomOutButton.hardInvalidate()
when size of a chart changes:
chart.events.on("sizechanged", ()=>{
chart.zoomOutButton.hardInvalidate()
})
Thanks. But this is for a zoom button, right? My button is not a zoom button, this is just a button. But I keep your suggestion in mind, I'll include this code in my package.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.