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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Align Legend boxes or place icon on right of label

Thread ID:

Created:

Updated:

Platform:

Replies:

128278 Jan 12,2017 12:48 AM UTC Jan 12,2017 10:04 AM UTC WPF 1
loading
Tags: SfChart
Sean Schellinger
Asked On January 12, 2017 12:48 AM UTC

Hi,

I currently have an sfchart with 3 rows. I have created a legend for each series and placed it to the left of (outside) the chart. Since the labels are of different lengths, the legends aren't left-side aligned. Is there a way to align the label boxes? Another option is to be able to place the icon to the right of the label, instead of to the left. Is this possible? Thanks!

Attachment: VentMon_b60ea734.zip

Devi Aruna Maharasi Murugan [Syncfusion]
Replied On January 12, 2017 10:04 AM UTC

Hi Sean, 
  
Thanks for contacting Syncfusion Support. 
  
Regarding icon to the right of the label 
  
We can achieve your requirement by setting the ItemTemplate property of chart legend. We have prepared the demo sample based on your requirement for your reference and it can be downloaded from below link, 
  
Sample: LegendAlignment 
  
Please refer our UG documentation link to know more about legend customization, 
  
  
Regarding Alignment of Legend, 
  
Since the legend label has different length, we can align them by setting the same Width for all the legend in the legend collection as shown in the below code snippet, 
 
  <syncfusion:ChartLegendCollection> 
          <syncfusion:ChartLegend  Width="250" />  
          <syncfusion:ChartLegend Width="250" />                                 
          <syncfusion:ChartLegend  Width="250"/>                                                                                    
</syncfusion:ChartLegendCollection> 
 
  
Regards, 
Devi 





CONFIRMATION

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.

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

;