# Labels

The Chart enables you to set the appearance and customize the content of the series and axis labels.

## Setting the Appearance

You can control the appearance of the labels through the following properties:

* `background`
* `border`
* `color`
* `font`
* `margin`
* `padding`

The following example demonstrates how to customize the appearance of the axis label by using the [`ChartValueAxisLabels`](https://www.telerik.com/kendo-react-ui/components/charts/api/chartvalueaxislabels) component.

[Demo Source](https://demos.telerik.com/kendo-react-ui/charts/chart/labels/style-axis/func/source.txt)

The following example demonstrates how to customize the appearance of the series label by using the [`ChartSeriesLabels`](https://www.telerik.com/kendo-react-ui/components/charts/api/chartserieslabels) component.

[Demo Source](https://demos.telerik.com/kendo-react-ui/charts/chart/labels/style-series/func/source.txt)

## Customizing the Content

Normally, the series and axis Chart labels display an unformatted numeric value or a category name.

You can override the Chart label content by:

* [Using format strings](https://www.telerik.com/kendo-react-ui/components/charts/chart/elements/labels#using-format-strings)
* [Setting content callbacks](https://www.telerik.com/kendo-react-ui/components/charts/chart/elements/labels#setting-content-callbacks)
* [Rendering custom visuals](https://www.telerik.com/kendo-react-ui/components/charts/chart/elements/labels#rendering-custom-visuals)

### Using Format Strings

The Chart enables you to assign a format string for the label. For the full list of available formats, refer to the [kendo-intl library](https://github.com/telerik/kendo-intl/blob/master/docs/num-formatting/index.md#types-of-number-formats).

#### Formatting Labels as Currency Values

The following example demonstrates how to format the value axis labels as a currency value.

[Demo Source](https://demos.telerik.com/kendo-react-ui/charts/chart/labels/chart-label/func/source.txt)

The following example demonstrates how to format the series labels as a currency value.

[Demo Source](https://demos.telerik.com/kendo-react-ui/charts/chart/labels/currency-value/func/source.txt)

#### Formatting Placeholders

Format strings for series labels can contain multiple value placeholders—for example, an X and Y value for the Scatter series. The following table lists the available placeholders.

| Series Type                                       | Placeholders                                                                      |
| :------------------------------------------------ | :-------------------------------------------------------------------------------- |
| Area, Bar, Column, Funnel, Pyramid, Line, and Pie | {0}—value                                                                         |
| Box Plot                                          | {0}—lower, {1}—q1, {2}—median, {3}—q3, {4}—upper, {5}—mean{6}—category            |
| Bubble                                            | {0}—X value, {1}—Y value, {2}—size value, {3}—category name                       |
| Bullet                                            | {0}—Value, {1}—Target value                                                       |
| RangeBar and RangeArea                            | {0}—from, {1}—to                                                                  |
| Scatter and ScatterLine                           | {0}—X value, {1}—Y value                                                          |
| Candlestick and OHLC                              | {0}—open value, {1}—high value, {2}—low value, {3}—close value, {4}—category name |

The following example demonstrates how to use value placeholders for the Scatter series labels.

[Demo Source](https://demos.telerik.com/kendo-react-ui/charts/chart/labels/scatter-series/func/source.txt)

### Setting Content Callbacks

If provided, a `content` function is called to compute the text of each label. The function receives different parameters depending on the context. For more information, refer to the documentation on [`ChartCategoryAxisLabelsProps`](https://www.telerik.com/kendo-react-ui/components/charts/api/chartcategoryaxislabelsprops#content), [`ChartValueAxisLabelsProps`](https://www.telerik.com/kendo-react-ui/components/charts/api/chartvalueaxislabelsprops#content), and [`ChartSeriesLabelsProps`](https://www.telerik.com/kendo-react-ui/components/charts/api/chartserieslabelsprops#content).

The following example demonstrates how to override the content of the axis labels.

[Demo Source](https://demos.telerik.com/kendo-react-ui/charts/chart/labels/content-callbacks/func/source.txt)

The following example demonstrates how to override the content of the series labels.

[Demo Source](https://demos.telerik.com/kendo-react-ui/charts/chart/labels/series-labels/func/source.txt)

### Rendering Custom Visuals

You can customize the rendering of labels by using a `visual` function. The function receives a single parameter of type [`AxisLabelVisualArgs`](https://www.telerik.com/kendo-react-ui/components/charts/api/axislabelvisualargs) or [`SeriesLabelsVisualArgs`](https://www.telerik.com/kendo-react-ui/components/charts/api/serieslabelsvisualargs), and returns a group of [Drawing primitives](https://www.telerik.com/kendo-react-ui/components/drawing/basic-shapes) to represent the label.

The following example demonstrates how to override the rendering of the axis labels.

[Demo Source](https://demos.telerik.com/kendo-react-ui/charts/chart/labels/visual-axis/func/source.txt)

The following example demonstrates how to override the rendering of the series labels.

[Demo Source](https://demos.telerik.com/kendo-react-ui/charts/chart/labels/visual-series/func/source.txt)

## Suggested Links

* [API Reference of the Chart](https://www.telerik.com/kendo-react-ui/components/charts/api)
