# Formatting Data Labels

## Content



FlexPie provides various options to format data labels according to your requirements. You can use connecting lines to connect the data labels, set and style borders of data labels, and customize the appearance of data labels.

The topic comprises of three sections:

*   [Setting and Styling Borders](/componentone/docs/wpf/online-flexchart/FlexPie/FPDataLabels/FormattingDataLabel#setting-and-styling-borders)
*   [Connecting DataLabels to Data Points](/componentone/docs/wpf/online-flexchart/FlexPie/FPDataLabels/FormattingDataLabel#connecting-datalabels-to-data-points)
*   [Modifying Appearance](/componentone/docs/wpf/online-flexchart/FlexPie/FPDataLabels/FormattingDataLabel#modifying-appearance)

### Setting and Styling Borders

To add and style borders to FlexPie data labels, set the **Border** and **BorderStyle** properties provided by <span data-popup-content="This class is available in \u003ca href=\u0022/componentone/api/wpf/online-flexchart/dotnet-api/C1.WPF.Chart/C1.WPF.Chart.DataLabel.html\u0022\u003e.NET\u003c/a\u003e and \u003ca href=\u0022/componentone/api/wpf/online-flexchart/dotnet-api/C1.WPF.Chart/C1.WPF.Chart.DataLabel.html\u0022\u003e.NET Framework\u003c/a\u003e." data-popup-title="DataLabel" data-popup-theme="ui-tooltip-green qtip-green">DataLabel</span> class.

Use the following code snippet to add borders to data labels of FlexPie.

**csharp**

```csharp
// Enable Border 
flexPie.DataLabel.Border = true;
```

![data labels](https://cdn.mescius.io/document-site-files/images/8ba28e07-1633-4a6a-9114-13b9f1f04eed/images/flexpiedlformat.png)

### Connecting DataLabels to Data Points

In case the data labels are placed away from the data points, you can connect them using connecting lines.

To enable connecting lines in FlexPie chart, you need to use the **ConnectingLine** property.

Use the following code snippet to set the connecting lines.

**csharp**

```csharp
//Enable connecting line
flexPie.DataLabel.ConnectingLine = true;
```

![data labels](https://cdn.mescius.io/document-site-files/images/8ba28e07-1633-4a6a-9114-13b9f1f04eed/images/datalabelsconnectinglines.png)

### Modifying Appearance

FlexPie includes various styling options, to enhance the clarity of data labels. To modify the appearance of FlexPie chart, you need to use the **Style** property. It allows you to modify the font family, fill color, use stroke brush for data labels, set width for stroke brush and more.

In the example code, we have modified the font used in the chart and set the stroke width property. Use the following code snippet to modify the appearance of the chart.

**csharp**

```csharp
// Modifying appearance of data labels
flexPie.DataLabel.Style.FontFamily = new FontFamily("GenericSerif");
flexPie.DataLabel.Style.StrokeThickness = 2;
```

![data labels](https://cdn.mescius.io/document-site-files/images/8ba28e07-1633-4a6a-9114-13b9f1f04eed/images/datalabelappearance.png)