You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: components/chart/labels-template-and-format.md
+68Lines changed: 68 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -188,6 +188,74 @@ In a **legend item label template**, you can use the following fields:
188
188
*`series` - the data series
189
189
*`value` - the point value (only for donut and pie charts)
190
190
*`percentage` - the point value represented as a percentage value. Available only for donut, pie and 100% stacked charts
191
+
192
+
193
+
### Hide Label Conditionally
194
+
195
+
In some cases, you want the series to have labels, but certain data points must not have a label. For example, in [stacked series]({%slug components/chart/stack%}) where a certain value is `0`.
196
+
197
+
To do that, you need to:
198
+
199
+
* add conditional logic in the template that renders the desired content when your condition is met, and returns nothing when it is not.
200
+
* ensure the labels background is transparent so there are no leftover spots on the chart.
0 commit comments