Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 如何在没有悬停的情况下以角度显示工具提示默认值?_Angular_Typescript_Angular2 Template - Fatal编程技术网

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,
    },
};