I have to format the value displayed in the middle of the gauge chart. I need the average value of five data to be displayed in middle as percentage. In the documentation it shows that using valueFormatting
we can format the value. Can anyone explain how to use the valueFormatting
function? I have attached the HTML code, data for the graph and snapshot of the graph.
HTML CODE:
<ngx-charts-gauge [view]="view3" [results]="avgTotScreentimeApp"></ngx-charts-gauge>
TS DATA CODE:
export var single = [
{
"name": "Germany",
"value": 10
},
{
"name": "USA",
"value": 10
},
{
"name": "France",
"value": 20
},
{
"name": "UK",
"value": 60
},
{
"name": "Italy",
"value": 50
},
{
"name": "Spain",
"value": 40
}
];
Expected O/P in the middle of the gauge : 38%
Instead, the gauge shows 38,340,000 in the center: