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.
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'
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.
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