How to set the customized adornment for WPF Olap Chart series?
This article explains how to apply customized adornments to individual series in a Syncfusion WPF OLAP Chart. By configuring the ChartAdornmentInfo object and assigning it to a specific series, you can control the visibility, symbol shape, size, and appearance of data point adornments.
Customized adornments help highlight important data points and improve the visual clarity of chart series.
Follow these steps to customize adornments for OLAP Chart series:
Step 1: Configure the OLAP Data Manager
Initialize the OlapDataManager, set the OLAP report, and attach the Loaded event to apply adornment customization. For more information, refer this getting started documentation
public MainWindow()
{
InitializeComponent();
this.olapChart.OlapDataManager =
new Syncfusion.Olap.Manager.OlapDataManager(
"Data Source=https://bi.syncfusion.com/olap/msmdpump.dll;" +
"Initial Catalog=Adventure Works DW 2008 SE;");
this.olapChart.OlapDataManager.SetCurrentReport(SampleReport());
this.olapChart.Loaded += OlapChart_Loaded;
}
Public Sub New()
InitializeComponent()
Me.olapChart.OlapDataManager =
New Syncfusion.Olap.Manager.OlapDataManager(
"Data Source=http://bi.syncfusion.com/olap/msmdpump.dll;" &
"Initial Catalog=Adventure Works DW 2008 SE;")
Me.olapChart.OlapDataManager.SetCurrentReport(SampleReport())
AddHandler Me.olapChart.Loaded, AddressOf OlapChart_Loaded
End Sub
Step 2: Create and Apply a Customized ChartAdornmentInfo
In the Loaded event, create a ChartAdornmentInfo object and assign it to a specific series using the AdornmentsInfo property.
void OlapChart_Loaded(object sender, RoutedEventArgs e)
{
ChartAdornmentInfo adornmentInfo = new ChartAdornmentInfo
{
Visible = true,
Symbol = Symbol.Diamond,
SymbolInterior = new SolidColorBrush(Colors.Pink),
SymbolWidth = 15,
SymbolHeight = 15
};
this.olapChart.OlapChartArea.Series[0].AdornmentsInfo = adornmentInfo;
}
Private Sub OlapChart_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
Dim adornmentInfo As New ChartAdornmentInfo()
adornmentInfo.Visible = True
adornmentInfo.Symbol = Symbol.Diamond
adornmentInfo.SymbolInterior = New SolidColorBrush(Colors.Pink)
adornmentInfo.SymbolWidth = 15
adornmentInfo.SymbolHeight = 15
Me.olapChart.OlapChartArea.Series(0).AdornmentsInfo = adornmentInfo
End Sub
Output
Conclusion
I hope you enjoyed learning how to set customized adornments for WPF OLAP Chart series.
You can refer to our WPF OlapChart featuretour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our WPF OLAP Chart demo 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!