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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Legend inside SfChart but docked to a corner.

Thread ID:





130277 May 3,2017 11:00 PM UTC May 4,2017 08:35 AM UTC WPF 1
Tags: SfChart
Asked On May 3, 2017 11:00 PM UTC


Does anybody have an idea for how to dock a legend inside the chart area and to a corner (specifically the top-right corner, with about 5 pixel margin)?

I figure that I need to set the LegendPosition of the Legend to be Inside.
The only DockPositions available are Left, Top, Right, Bottom, and Floating. All of these options except Floating put the legend at the center of the side they represent.

If I set it to Floating, then it looks like I can use OffsetX and OffsetY to position it but that's in relation to the top-left corner, I'm wondering if there is a straightforward way to position it based on the top-right corner instead. I'm trying to avoid having to calculate the size of the chart, axes, margins etc. and then position it based on all that.

Also, since you have options to dock the legend to the right of the chart area, would it be possible for a future release to have options to dock the legend inside the chart to any of the 4 corners?

Any help is appreciated.



Devi Aruna Maharasi Murugan [Syncfusion]
Replied On May 4, 2017 08:35 AM UTC

Hi James, 
Thanks for contacting Syncfusion Support. 
Currently we don’t have direct support for placing the chart legend at the top – right corner inside the chart area. However, we achieve this requirement by setting the DockPosition property of chart legend as Floating and adjusting the value of OffsetX and OffsetY property as shown in the below code snippet, 
   <chart:ChartLegend DockPosition="Floating" OffsetX="1200" 
Please find the output image 
We have prepared a demo sample for your reference and it can be downloaded from below link, 
Sample: DockPosition 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

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

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