在 ng2-charts 中隐藏三个工具提示之一

Hide one of three tooltip in ng2-charts

我正在使用引用的气泡图from .我为图表数据提供了三个值。一个是 x ,另一个是 y ,最后一个是 r 作为半径。所有三个都显示在工具提示中,我只想在工具提示中显示 x 和 y。

HTML

<div style="display: block" *ngIf="ChartData">
<canvas baseChart  width="400" height="180" [datasets]="ChartData" [labels]="ChartLabels" [options]="ChartOptions" [legend]="ChartLegend"
[chartType]="ChartType" (chartHover)="chartHovered($event)" (chartClick)="chartClicked($event)"></canvas>
</div>

TS

    public ChartOptions:any = {
    scaleShowVerticalLines: false,
    responsive: true
  };
  public ChartLegend:boolean = true;
  public ChartType:string = 'bubble';
  public ChartData:any[] = [
    {
      data:[
        {x:15,y:15.59,r:7.5},
      ],
      label:'Series A',
      backgroundColor:'#FF6384',
      hoverBackgroundColor:'#FF6388'},
}]
}

  public ChartOptions:any = {
    scaleShowVerticalLines: false,
    responsive: true,
    scales: {
      yAxes: [{
          ticks: {
              beginAtZero: true
          }
      }],
      xAxes: [{
        ticks: {
            beginAtZero: true
        }
    }],

  }
  };

我不需要在工具提示中显示 7.5。

Using angular2-chartjs,因为 ng2-charts 不再支持气泡图。

StackBlitz Editor

Working Demo