Category / Section
How to add watermark to the Chart?
1 min read
Description:
Watermark is the copyright information of the user it belongs to. SfChart provides Watermark support to add text or images to the chart area. This article describes how to include a watermark content inside the chart area.
Solution:
Watermark can be added to the chart area as text, image, or both. The following example illustrates how to add watermark to the Chart.
The HorizontalAlignment and VerticalAlignment properties are used to position the watermark inside the plot area.
XAML
<!--Adds Watermark to Chart--> <syncfusion:SfChart.Watermark> <syncfusion:Watermark HorizontalAlignment="Center" VerticalAlignment="Center"> <syncfusion:Watermark.Content> <TextBlock Text="Temperature Report" FontSize="32" 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 = 32; chart.Watermark.Foreground = new SolidColorBrush(Colors.Gray); }
Figure 1: Watermark in the Chart