apexcharts / ng-apexcharts

ng-apexcharts is an implementation of apexcharts for angular. It comes with one simple component that enables you to use apexcharts in an angular project.
MIT License
330 stars 81 forks source link

ng-apexcharts Angular 16 - Cannot read properties of undefined (reading 'dataURI') #288

Open Tfasesa opened 1 year ago

Tfasesa commented 1 year ago

No encuentra referencia del objeto apexchart "undefined", En el componente: import { ApexAxisChartSeries, ApexChart, ChartComponent, ApexDataLabels, ApexPlotOptions, ApexResponsive, ApexXAxis, ApexLegend, ApexFill, NgApexchartsModule } from "ng-apexcharts"; import * as ApexCharts from 'apexcharts'

@Component({ selector: 'app-grafica1', standalone: true, imports: [ NgApexchartsModule, ...

... @ViewChild('chart') mychar: ChartComponent; ... .. this.chartOptions = { series: [ .. this.mychar.dataURI().then(function (e) { ....

Html: <apx-chart #chart [series]="chartOptions.series" [chart]="chartOptions.chart" [dataLabels]="chartOptions.dataLabels" [plotOptions]="chartOptions.plotOptions" [responsive]="chartOptions.responsive" [xaxis]="chartOptions.xaxis" [legend]="chartOptions.legend" [fill]="chartOptions.fill" [colors]="chartOptions.colors"

Error: ERROR TypeError: Cannot read properties of undefined (reading 'dataURI')

Package "apexcharts": "^3.44.0", "ng-apexcharts": "^1.8.0", "@angular/cli": "~16.1.0",

El gráfico se presenta sin problemas, funciona bien la parte visual, pero al exportar desde script con la función dataURI presenta problema

Agradezco puedan ayudarme con el error

github-actions[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.