I am currently using ngx-charts, specifically the bar-horizontal module. My goal is to format the data labels and add a percentage symbol at the end. I attempted to use the [xAxisTickFormatting] property, but it seems that my values are located within the ngx-charts-series-horizontal component rather than the ngx-charts-x-axis.
The ngx-charts implementation looks like this:
<ngx-charts-bar-horizontal
*ngIf='givesEnergyChartData && givesEnergyDataColorScheme'
[scheme]="givesEnergyDataColorScheme"
[results]="givesEnergyChartData"
[gradient]="gradient"
[xAxis]="showXAxis"
[yAxis]="showYAxis"
[legend]="showLegend"
[view]="viewGiveEnergy"
[showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel"
[showDataLabel]="showDataLabel">
</ngx-charts-bar-horizontal>
I also attempted to manually format the data array (I know it was not the best approach, but I gave it a try):
this.givesEnergyChartData = this.statistic.givesEnergyData.map(
s => {
return { name: s.name, value: s.count }
});
where I tried adding '+ '%' for the value: s.count.
So, what steps can I take to properly format the data labels and append a '%' after the values?