title: How to get the Label name of the pie chart using angular
body: <p>I just created pie chart in angular 8. And I can able to view it. But I just want to get the label name based on the pie chart click.</p>
  
  <p><strong>Image:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/ULEuP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ULEuP.png" alt="enter image description here"></a></p>
  
  <p>Installed </p>
  
  <pre><code>npm install ng2-charts
  </code></pre>
  
  <p>Added below lines in html file:</p>
  
  <pre><code>&lt;div style="display: block"&gt;
      &lt;canvas id="pie" baseChart
              [data]="pieChartData"
              [labels]="pieChartLabels"
              [chartType]="pieChartType"
              (chartHover)="chartHovered($event)"
              (chartClick)="chartClicked($event)"&gt;&lt;/canvas&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>Added below lines in script file:</p>
  
  <pre><code> public pieChartLabels: string[] = ['PayCreditWallet','Paypal','Google Pay','Amazon Pay'];
   public pieChartData: number[] = [1,2,3,4];
   public pieChartType: any = 'pie';
  
    // events
    public chartClicked(e: any): void {
      alert(e);
    }
  
   public chartHovered(e: any): void {
  
      console.log(e.data);
    }
  </code></pre>
  
  <p>When I click the Label (slice) in pie chart I can see click event as alert as mentioned above. Is it possible to get the label name when I click the specific label in pie chart (Slice). Example: In pie chart if I click 'AmazonPay' alert should shows 'AmazonPay'. I don't know how to achieve this. Can someone please help me on this?</p>