Charts - Label
Customize how series and data points are labeled in charts.
A label is the text that identifies a series or data point in a chart, appearing in locations such as the legend, tooltip, or directly on chart elements.
You can set a series label by passing a string to the label property of a series.
The label appears in different locations such as the legend and tooltip.
- label 1
Conditional formatting
The label property accepts a function that lets you change the label content based on location.
The function receives location as its first argument, which can have the following values:
- simple label
- legend label
Pie chart labels
The Pie chart behaves differently due to its nature.
It has labels per slice instead of per series, and provides one additional location where labels can be rendered.
Instead of receiving the label as part of the series, it receives it as part of the data set inside a series.
The location argument can have the following values:
- legend+A
- legend+B
- legend+C
API
See the documentation below for a complete reference to all of the props and classes available to the components mentioned here.