score:2

Accepted answer

i fixed my issue,

i used this [legend]="doughnutchartlegend"

.html

<canvas basechart
                        [data]="doughnutchartdata" [labels]="doughnutchartlabels"
                        [options]="doughnutchartoptions" [legend]="doughnutchartlegend"
                        [charttype]="doughnutcharttype"
                        [colors]="[{backgroundcolor: ['rgb(116, 90, 242)', 'rgb(30, 136, 229)', '#06d79c', 'rgb(236, 239, 241)']}]"
                        (charthover)="charthovered($event)"
                        (chartclick)="chartclicked($event)"></canvas>

.ts

// doughnut
  public doughnutchartlabels: string[] = [
    'total',
    'vacant dirty',

  ];
  public doughnutchartoptions: any = {
    borderwidth: 2,
    maintainaspectratio: true,
   cutoutpercentage: 55,
  };
  responsive: true;
  public doughnutchartdata: number[] = [51, 1];
  public doughnutcharttype: string = 'doughnut';
  public doughnutchartlegend: boolean = false;

Related Query

More Query from same tag