How to show custom data marker in the WPF Chart?
This KB explains how to show a custom data marker in the WPF Chart.
You can show the custom adornment symbols in series using the ChartAdornmentInfo SymbolTemplate property by the following steps.
Define the desired symbol in the ResourceDictionary using the DataTemplate. And assign the declared DataTemplate to the SymbolTemplate property of ChartAdornmentInfo as per the following code snippet.
<syncfusion:SfChart > <syncfusion:SfChart.Resources> <ResourceDictionary> <DataTemplate x:Key="crossTemplate"> <Grid Height="15" Width="15"> <Path Stretch="Fill" Stroke="{Binding Interior}" Fill="{Binding Interior}" Data="F1 M 133.133,45.7109L 154.307, 24.5363L 175.482,45.7109L 154.307,66.8856L 175.482,88.0603L 154.307,109.235L 133.133,88.0603L 111.958,109.235L 90.7835, 88.0603L 111.958,66.8856L 90.7835,45.7109L 111.958,24.5363L 133.133,45.7109 Z " /> </Grid> </DataTemplate> </ResourceDictionary> </syncfusion:SfChart.Resources> ……… <syncfusion:LineSeries ItemsSource="{Binding Data}" XBindingPath="XValue" YBindingPath="YValue"> <syncfusion:LineSeries.AdornmentsInfo> <syncfusion:ChartAdornmentInfo SymbolTemplate="{StaticResource crossTemplate}"> </syncfusion:ChartAdornmentInfo> </syncfusion:LineSeries.AdornmentsInfo> </syncfusion:LineSeries> </syncfusion:SfChart>
Output:
See also:
How to show multiple custom data marker based on value in chart series
How to rotate text in data marker
How to display the labels inside segments
Conclusion
I hope you enjoyed learning about how to vary the custom shapes in WPF Chart.
You can refer to our WPF Chart feature tour page to know about its other groundbreaking feature representations. You can also explore our WPF Chart documentation 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!