Legend displays an entry for each data series in the chart. It allows you to identify the corresponding data represented in charts. In FlexPie, you can customize the legend of charts in various ways. For example, you can change the orientation and position of legends. Let us understand them in detail:
The following code snippet shows how to set the property.
Each legend label should be concise and descriptive, clearly indicating the category or data points it represents. FlexPie allow you to format such legend items using the LegendItemFormat event provided by the FlexChartBase class.
The following image displays FlexPie with the formatted legend labels.
The following code snippet shows how the legend labels are formatted.
C# |
コードのコピー
|
---|---|
flexPie.LegendItemFormat += (s, e) => { var data = (FruitDataItem)e.Item; e.Text = $"{data.April}={data.Fruit}"; }; |