Estoy trabajando en amcharts. al exportar la imagen del gráfico, el gráfico tarda demasiado, como 3 a 4 segundos, necesito mostrar el cargador durante el tiempo de espera, ¿hay alguna funcionalidad relacionada con la versión 4 de amcharts?
Código de demostración para el gráfico (el gráfico a continuación no toma demasiado tiempo porque es solo un código de demostración)
/** * --------------------------------------- * This demo was created using amCharts 4. * * For more information visit: * https://www.amcharts.com/ * * Documentation is available at: * https://www.amcharts.com/docs/v4/ * --------------------------------------- */ // Create chart instance var chart = am4core.create("chartdiv", am4charts.XYChart); // Add data chart.data = [{ "category": "Research & Development", "value": 3.5 }, { "category": "Marketing", "value": 6 }, { "category": "Distribution", "value": 4.2 }]; // Create axes let categoryAxis = chart.xAxes.push(new am4charts.CategoryAxis()); categoryAxis.dataFields.category = "category"; let valueAxis = chart.yAxes.push(new am4charts.ValueAxis()); // Create series var series = chart.series.push(new am4charts.ColumnSeries()); series.dataFields.valueY = "value"; series.dataFields.categoryX = "category"; series.name = "Sales"; // Enable export chart.exporting.menu = new am4core.ExportMenu(); body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; } #chartdiv { width: 100%; height: 300px; } <script src="//www.amcharts.com/lib/4/core.js"></script> <script src="//www.amcharts.com/lib/4/charts.js"></script> <div id="chartdiv"></div>En el siguiente ejemplo, necesito mostrar el cargador cuando el usuario exporta el gráfico a una imagen o Excel, etc.
Intenté agregar javascript usando el nombre de la clase, pero no pude detectar el evento de clic en el botón de exportación.