My Angular project involves exporting a chart to various formats, such as png, jpeg, pdf, and SVG. However, I am encountering an issue when trying to export the chart as CSV or . I have attempted the following code:
this.lineChart.chart.downloadCSV(); //For CSV
@ViewChild("lineChart", { static: false }) lineChart: any;
Highcharts = Highcharts;
chartOptions = {
series: [
{
name: "Current - 2014",
data: [
{
name: "1",
y: 200030
},
{
name: "2",
y: 23300
},
...
},
exporting: {
enabled: true,
showTable: false,
fileName: "line-chart"
}};
An error is appearing in the console:
AppComponent.html:16 ERROR TypeError: Cannot read property 'decimalPoint' of undefined
at d.Chart.b.Chart.getCSV (export-data.src.js:760)
at d.Chart.b.Chart.downloadCSV (export-data.src.js:978)
...
If anyone can assist with this issue, you can find the demo project at the following link:
https://stackblitz.com/edit/angular-chart-export?file=src%2Fapp%2Fapp.component.ts
I appreciate any help in advance.