How to add watermark in WPF Chart (SfChart) ?
The WPF Chart (SfChart) provides watermark support to add text or images to the chart area. You can add the text to chart background using the Content property of Watermark. If you want to set watermark inside the plot area, you can use the HorizontalAlignment and VerticalAlignment properties.
XAML
<!--Adds Watermark to Chart--> <syncfusion:SfChart.Watermark> <syncfusion:Watermark HorizontalAlignment="Center" VerticalAlignment="Center"> <syncfusion:Watermark.Content> <TextBlock Text="Temperature Report" FontSize="60" Foreground="Gray"/> </syncfusion:Watermark.Content> </syncfusion:Watermark> </syncfusion:SfChart.Watermark>
C#
private void MyChart() { SfChart chart = new SfChart(); chart.Watermark.HorizontalAlignment = HorizontalAlignment.Center; chart.Watermark.VerticalAlignment = VerticalAlignment.Center; chart.Watermark.Content = "Temperature Report"; chart.Watermark.FontSize = 60; chart.Watermark.Foreground = new SolidColorBrush(Colors.Gray); }
Output:
Conclusion
I hope you enjoyed learning how to add watermark in WPF Chart.
You can refer to our WPF Chart feature tour page know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our WPF Chart Examples to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!