How can I add an icon below the Echart title? I have attempted the following but have been unsuccessful in rendering the icon.
https://i.sstatic.net/PUURP.png
The code in my component.ts file is as follows:
constructor(private sanitizer: DomSanitizer) {}
ngOnInit(){
this.iconHtml = this.sanitizer.bypassSecurityTrustHtml('<i class="fa fa-chart-bar"></i>');
this.costByTypeChart();
}
costByTypeChart(){
this.typeoptions = {
title: {
text: `<div [innerHTML]="iconHtml"></div>`,
subtext: "Data not loaded yet",
left: "center",
top: "center",
subtextStyle: {
fontSize: 20,
}
},
yAxis: [],
series: []
}
};
}
In the component.html file:
<p-card header="Cost By Type">
<div echarts [options]="typeoptions" [ngStyle]="{width: '100%',height:'100%'}"></div>
</p-card>
This is the output I am currently receiving: