How to display values on chart
Last updated
Last updated
We have a column chart where we have displayed the sales for each month.
We are going to display the total sales for each month on the chart. For this, we can use the "Text Template" field.
To add Y values as columns' labels, we enter %{y}
into the Text Template field.
As you see, Y values are added at the end of inside of each column. Also, it formats some of the values automatically for better appearance.
To customize the format of label's numbers (or date-time), Plotly uses D3 format method, which you can see on Formatting Cheat Sheet page.
In our case, if we want to display sales with as currency and use SI-prefix with two significant digits we can change the text template to %{y:$.2s}
that makes the labels looks: