Angular 如何在没有悬停的情况下以角度显示工具提示默认值?
我需要将工具提示设置为默认值,并且它不应该仅以鼠标悬停的形式出现。。例如,在下图中,当我们悬停时,红色部分将显示“停止”,而当我们悬停绿色部分时,将显示“正在运行”,但我需要该工具提示在没有悬停事件的相应部分处于默认状态 我使用的角度代码是Angular 如何在没有悬停的情况下以角度显示工具提示默认值?,angular,typescript,angular2-template,Angular,Typescript,Angular2 Template,我需要将工具提示设置为默认值,并且它不应该仅以鼠标悬停的形式出现。。例如,在下图中,当我们悬停时,红色部分将显示“停止”,而当我们悬停绿色部分时,将显示“正在运行”,但我需要该工具提示在没有悬停事件的相应部分处于默认状态 我使用的角度代码是 <canvas baseChart [data]="doughnutChartData" [labels]="doughnutChartLabels" [chartType]="doughnutC
<canvas baseChart
[data]="doughnutChartData"
[labels]="doughnutChartLabels"
[chartType]="doughnutChartType"
[colors]="colors"
[options]="options"
(chartHover)="chartHovered($event)"
(chartClick)="chartClicked($event)">
</canvas>
图像中包含的部分是
在这里,默认情况下,工具提示应显示在红色和绿色部分,即使不将鼠标悬停在其上。您的脚本用于饼图的哪个图表??
public doughnutChartLabels:string[] = ['Running', 'Stop', 'Idle'];
public doughnutChartData:number[] ;
public doughnutChartType:string = 'doughnut';
public colors: any[] = [{ backgroundColor: ["#008000", "#FF0000", "#FFA500"] }];
devices : Device[];
deviceLength : number;
public options:any = {
Label: {
display: true,
},
// legend: {position: 'bottom'},
legend: {
enabled: true,
},
tooltips: {
enabled: true,
},
};