ng-apexcharts Angular 16 - Cannot read properties of undefined (reading 'dataURI')
Opened this issue · 1 comments
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
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.