I have a bar chart where each month has a value in the billions. Is there a way to format the labels to show this value in billions, with a "B" label?
E.g., August's value is 17610171495, but I would like to show it as 17.6B, just like the how it displays when I hover over the bar.
Is there a way to use "texttemplate" to do this? Is there a way to dynamically have it show the value in either B (billions) or M (millions)? Below is the current code I have for the labels:
//labels
"text": {{formatDataAsObject(spot_monthly.data)['Kraken Spot']}},
"textposition": "outside",
"textfont": {"color":'#000000', "size":10},
"texttemplate": "%{text:.1f}",
//labels
Currently, I can use a work-around where in my dataset, I add an additional column just for the labels. E.g., column 1 is the actual value of 17610171495, and column 2 for labels is 17.610171495