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

LabelContent for chart to include both percentage and y value?

using the pieSeries and currently just have the ChartDataMarker set with a LabelContent = LabelContent.Percentage - which is ok, however I'd also like to show the count (i.e. "%28 (142)") - both numbers are useful.  Doesn't look to be an option currently, if not I'd like to submit it for a feature request.
thanks

4 Replies

JC Jaikrishna Chandrasekar Syncfusion Team June 27, 2016 01:00 PM UTC

Hi Jeff Lindborg,  
   
Thanks for contacting Syncfusion support.   
  
We can show both the percentage values and Y values in the data marker label by using ChartDelegate in iOS and CustomRenderer in Andriod.   
    
In iOS:   
ChartDelegate has a method called GetFormattedAxisLabel using that we can display the Y values along with the percentage values.   
    
In Android:   
SfChart has an event called DataMarkerLabelCreated using that we can display the Yvalues along with percentage values.   
    
We have prepared a sample and it can be downloaded from the below location.   
  
  
Regards,   
Jaikrishna C   



BG bg January 30, 2017 10:00 AM UTC

What about the data marker for a circular gauge ? I want to show the value as percentage inside the circular gauge using data binding, which in the viewmodel is given as an integer. 


BG bg January 30, 2017 10:05 AM UTC

how can I add a postfix to the header of a circular gauge?



SP Subburaj Pandian Veluchamy Syncfusion Team January 31, 2017 08:41 AM UTC

Hi Bg, 
 
Based on the provided information, we have checked and your requirement of setting postfix label along with the HeaderText in SfCircularGauge Xamarin Forms can be achieved by adding the required symbol with the HeaderText in the code behind. Since HeaderText is a String you can convert and set Text as per this requirement. Please refer the below code example, 
 
[c#] 
header.Text = header.Text + "%"; 
 
 
We have prepared sample based on the mentioned scenario, please find the below sample. 
 
Sample link: GaugeHeader_Sample 
 
In the sample, we have added CircularGauge properties in the XAML and bind the pointer values and HeaderText. As mentioned in the code example added the HeaderText in the propertyChanged on HeaderText. 
 
If the given solution doesn’t meet your requirement, could you please revert to us by modifying the provided sample based on your requirement with more information about your query, it will be helpful for us to analyze on it and provide you a better solution. 
 
Regards,  
Subburaj Pandian V.  
 


Loader.
Up arrow icon