Closed ArkyBald closed 7 months ago
Hi @ArkyBald by text labels do you mean for example LineChart.Tooltip
or LineChart.PriceText
? If so, the formatting of those can be controlled using the format
worklet function.
Would like to piggy bag on this. In my use case I only work with whole numbers. Would be nice to be able to set formatting on the tooltip directly, or also have the prop 'variant' to display the value as is, and not having the double float digit.
@arancauchi resurfacing this issue.
There is no apparent way to format a tooltips text. The format
worklet only works with PirceText, not with the tooltip.
Any ideas?
The format function actually does work with the tooltip:
@JuanRdBO thanks for the tip, but unfortunately getting the following error when trying to do it with
textProps={{
format: ({ formatted }) => {
return Number(formatted).toFixed(0);
},
}}
@JuanRdBO actually you're right, adding the worklet directive solves it
textProps={{
format: ({ value }) => {
'worklet';
return Number(value).toFixed(0);
},
}}
Would be nice to have the ability to control the precision of textlabels, similar to how the price display works. Thanks