How to wrap the title of the WinUI (SfCartesianChart)?
This article explains how to wrap the header in the WinUI CartesianChart.
The Header property is used to set the title for the SfCartesianChart. Use any view or string for the Header property, which provides quick information to the user about the data being plotted in the chart. By using the TextWrapping property in the TextBlock, wrap the header while resizing the window. The following code example explains how to wrap the header in the SfCartesianChart.
[Xaml]
<chart:SfCartesianChart Margin="10" >
…
<chart:SfCartesianChart.Header>
<TextBlock FontWeight="Bold"
Text="Most popular product categories among Amazon sellers"
TextWrapping="Wrap" >
</TextBlock>
</chart:SfCartesianChart.Header>
…
</chart:SfCartesianChart>
[C#]
SfCartesianChart chart = new SfCartesianChart();
…
TextBlock textBlock = new TextBlock()
{
FontWeight = FontWeights.Bold,
Text = "Most popular product categories among Amazon sellers",
TextWrapping = TextWrapping.Wrap,
};
chart.Header = textBlock;
…
Output
Conclusion
I hope you enjoyed learning about how to wrap Chart title text in WinUI.
You can refer to our WinUI Cartesian Chart feature tour page to know about its other groundbreaking feature representations. You can also explore our WinUI Cartesian Chart documentation to understand how to present and manipulate data.
For current customers, you can check out our WinUI Controls from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our WinUI Cartesian Chart and other WinUI controls.
If you have any queries or require clarifications, please let us know in comments below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!