Customize legend labels with format strings
masterThe :format key in the legend configuration uses Ruby's format sequences and specific named placeholders to build labels:
<label>: The icon matching the pie chart display.<name>: The:nameprovided in the data.<value>: The:valueprovided in the data.<currency>: The value formatted as currency.<percent>: The automatically calculated percentage.
Default format: "%<label>s %<name>s %<percent>.2f%%"
# Example: Displaying value and percent
legend: {
format: "%<label>s %<name>s %<value>d (%<percent>.2f%%)"
}
# Example: Displaying as currency
legend: {
format: "%<label>s %<name>s $%<currency>s (%<percent>.0f%%)",
precision: 3,
delimiter: "*"
}