swimlane / ngx-charts

:bar_chart: Declarative Charting Framework for Angular
https://swimlane.github.io/ngx-charts/
MIT License
4.3k stars 1.15k forks source link

option to pass title on dataLabelFormating not just the value number also the title #1882

Open Iyal-Khanjar opened 1 year ago

Iyal-Khanjar commented 1 year ago

Is your feature request related to a problem? Please describe. on data label formatting i want to show also the title name not just the value i know it is in the x label but i want it also on the data label where the value's is or if there is a way to know which the title of the bar the value on

Describe the solution you'd like something like this to add a title ` <ngx-charts-bar-vertical [maxXAxisTickLength]=50 [yAxisTickFormatting]="yAxisTickFormattingFn" [xAxisTickFormatting]="xAxisTickFormattingFn" [dataLabelFormatting]="dataLabelFormattingFn" [showDataLabel]="true" [results]="performance" [scheme]="colorScheme" [legend]="false" [showXAxisLabel]="true" [showYAxisLabel]="true" [xAxis]="true" [yAxis]="true" [gradient]="false"

<ng-template #tooltipTemplate let-model="model" > {{ tooltip(model) }} where dataLabelFormatting is private dataLabelFormatting(value: number, title: string) { return title + value + "%"; }`

Describe alternatives you've considered nothing

Additional context I have this code image and dataLabelFormattingFn is image

how can i know the value at which bar title is it

Iyal-Khanjar commented 1 year ago

Any one Have a solution?