gpt4 book ai didi

angular - 隐藏 ngx 高级饼图图例

转载 作者:行者123 更新时间:2023-12-04 15:46:02 24 4
gpt4 key购买 nike

我想隐藏ngx高级饼图的图例,在圆圈中间显示图片

问题陈述:无法隐藏高级饼图的图例

我想隐藏图例并在带有数据的圆圈中显示图像。

plnkr code

代码:

//our root app component
import {Component, NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {BrowserAnimationsModule} from '@angular/platform-browser-animations';
import {NgxChartsModule} from '@swimlane/ngx-charts';
import {single, multi} from '../data.ts';

@Component({
selector: 'my-app',
template: `
<ngx-charts-advanced-pie-chart
[view]="view"
[scheme]="colorScheme"
[results]="single"
[gradient]="gradient"
(select)="onSelect($event)">
</ngx-charts-advanced-pie-chart>
`
})
export class App {
single: any[];
multi: any[];

view: any[] = [700, 400];

colorScheme = {
domain: ['#5AA454', '#A10A28', '#C7B42C', '#AAAAAA']
};

constructor() {
Object.assign(this, {single, multi})
}

onSelect(event) {
console.log(event);
}

}


@NgModule({
imports: [ BrowserModule, BrowserAnimationsModule, NgxChartsModule ],
declarations: [ App ],
bootstrap: [ App ]
})
export class AppModule {}

最佳答案

可以通过在我们的 style.css 文件中添加以下样式来隐藏图例

.advanced-pie-legend-wrapper{
display: none !important;
}

关于angular - 隐藏 ngx 高级饼图图例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55742339/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com