在Angular Google图表中导出为CSV功能

问题描述

我在Angular 9项目中使用[angular-google-charts](https://www.npmjs.com/package/angular-google-charts)。要求是提供“导出到csv功能”。以下是Google图表的示例代码。代码将如何提供下载csv的选项:

app.component.html

<google-chart #chart  [title]="title"  [type]="type"  [data]="data"  [columnNames]="columnNames" 
  [options]="options"  [width]="width"  [height]="height"> </google-chart>

app.component.ts

import { Component } from '@angular/core';
@Component({
selector: 'app-root',templateUrl: './app.component.html',styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'Population (in millions)';
type = 'ColumnChart';
data = [
  ["2012",900],["2013",1000],["2014",1170],["2015",1250],["2016",1530]
];
columnNames = ['Year','Asia'];
options = {};
width = 550;
height = 400;
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)