title: How to insert array data into chart of ng2-google-chart in angular 7
body: <p>I use an angular development environment 7
  And I'm trying to run a pie chart of ng2 google chart
  Via API - and angular service.</p>
  
  <p>Attached is a picture of my TS file</p>
  
  <p>Question: How do I enter the values ​​that come from my array to the DataTable of the chart?</p>
  
  <p>Thanks</p>
  
  <pre><code>
  constructor(private _getIncomeService: getIncomeService) { }
      _GetAveragesModel: GetAveragesModel[];
  
      ngOnInit() {
          this.fnGetAverages();
      }
      fnGetAverages() {
          this._getIncomeService.GetAverages(279).subscribe(x =&gt; {
              this._GetAveragesModel = x;
          });
      }       
      public pieChart = {
          chartType: 'PieChart',
          dataTable: [
              ['Task', 'Hours per Day'],
              ['ss', 11],
              ['Eat', 2],
              ['Commute', 2],
              ['Watch TV', 2],
              ['Sleep', 7]
          ],
          options: {
              title: 'Tasks',
              slices: {
                  0: { offset: 0.3 },
                  1: { offset: 0.2 },
              },
              width: '100%', height: '100%',
              is3D: true,
              chartArea: {left: "3%",top: "3%",height: "94%",width: "94%"}
          }
      };
  ```[enter image description here][1]
  
  
    [1]: https://i.stack.imgur.com/1RMwk.png
  </code></pre>