我使用的气泡图是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。