ComponentOne FlexChart for WinForms
Legend Text Wrap
FlexChart > Working with FlexChart > FlexChart Elements > Legend > Legend Text Wrap

Legend text wrap is a feature to shorten the legend entries by either truncating or wrapping them into multiple lines. This feature gives user the flexibility to effectively utilize chart display area by adjusting the space occupied by legends.

FlexChart provides text wrapping for the legend text that exceeds the value specified in ItemMaxWidth property, which sets the maximum width of each legend entry. The control enables you to manage legend entries in following two ways:

In FlexChart, the maximum width set for the legend entries affects both text wrapping and text truncating. The greater the value set for maximum legend entry width, the less the legend text is wrapped or truncated.

The following image displays legend texts wrapped into multiple lines.


The following image displays truncated legend texts.


The following code shows how to implement legend text wrapping in FlexChart.

' set maximum width of legend items
FlexChart1.Legend.ItemMaxWidth = 80

' set legend text wrap mode
FlexChart1.Legend.TextWrapping = C1.Chart.TextWrapping.Wrap

' set legend position
FlexChart1.Legend.Position = C1.Chart.Position.Right
// set maximum width of legend items
flexChart1.Legend.ItemMaxWidth = 80;

// set legend text wrap mode
flexChart1.Legend.TextWrapping = C1.Chart.TextWrapping.Wrap;
            
// set legend position
flexChart1.Legend.Position = C1.Chart.Position.Right;
See Also