score:0

try to use bind() to bind context to a function.

public piechartoptions: chartoptions = {
    responsive: true,
    legend: {
      position: 'left',
      onclick: this.handleclick.bind(this, event, item)
    },
    title: {text: '', display: true}
  };

  handleclick(ev, item): void {
     this.legendclick.emit(item.index)
  }

Related Query

More Query from same tag