How do I dock the Chart legend programatically?
(Views :1459)

ChartLegend can be docked using Dock property of Dockpanel class. And the chart legend can be aligned using the alignment property


The following lines of code are used to add the legend to a chart and dock the legend to a position and set its alignment respectively


[XAML]


<syncfusion:Chart.Legends>    <syncfusion:ChartLegend syncfusion:ChartDockPanel.Dock="Top" syncfusion:ChartDockPanel.Alignment="Near"/> </syncfusion:Chart.Legends>  


When floating mode is used, the legend can be placed at any place within the chart area using the margin property of the legend class. The following line of code illustrates how to place the legend in floating mode.


<syncfusion:ChartLegend syncfusion:ChartDockPanel.Dock="Floating" Margin="10,10,10,10"/>

::adCenter::