We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to float the legend on chart?

Platform: Xamarin.Forms |
Control: SfChart


Legends are not restricted to be positioned on the top of the chart. It can be placed on or around the plot area. This article describes how the legends position can be customized.



Essential chart for Xamarin.Forms provides the following properties to align or position the legends anywhere in the chart.

The DockPosition property is used to position the legends at the bottom, left, right, or top of the chart, and the Floating property is used to position the legends anywhere over the plot area using the coordinates.

The OffsetX and OffsetY properties are used to provide horizontal and vertical offsets for the legends. These properties work only when the DockPosition is set to Floating.

The following code illustrates how to use this property.


       <chart:ChartLegend OffsetX="50" OffsetY="45" 
         DockPosition="Floating" />


chart.Legend = new ChartLegend()
  OffsetX = 50,
  OffsetY = 45,
  DockPosition = LegendPlacement.Floating



Chart legend position is customized in Xamarin.Forms

2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile