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.
Unfortunately, activation email could not send to your email. Please try again.

Adding text to DataMarker

Thread ID:





124670 Jun 21,2016 03:04 PM Aug 3,2016 10:17 AM Xamarin.Forms 5
Tags: SfChart
Drew Wilson
Asked On June 21, 2016 03:04 PM

How can I add additional text to data markers on a doughnut chart? Currently I have

<chart:ChartDataMarker LabelContent="YValue">

which displays a number as the data marker but I need to format that number to represent money.

So, essentially, I need to add a "$" before the number on the marker but something like the following does not work (obviously)

<chart:ChartDataMarker LabelContent="$YValue">


Jaikrishna Chandrasekar [Syncfusion]
Replied On June 22, 2016 08:43 AM

Hi Drew Wilson,  
Thanks for contacting Syncfusion support.   
We can add additional text to datamarker label. The LabelStyle of ChartDataMarker has a Property called LabelFormat which is used to format the datamarker labels. By using this LabelFormat, we can add $ symbol as prefix to the datamarker label.   
The following code illustrates how to add $ symbol as prefix to datamarker labels.   
<chart:DoughnutSeries  ItemsSource="{Binding data}">
                              <chart:DataMarkerLabelStyle LabelFormat ="$"/>
        </ chart:DoughnutSeries.DataMarker>
</ chart:DoughnutSeries  >  
DoughnutSeries series = new DoughnutSeries ();
series.ItemsSource = data;
series.DataMarker = new ChartDataMarker () {
           LabelStyle = new DataMarkerLabelStyle (){LabelFormat="$"},
Jaikrishna C   

Drew Wilson
Replied On June 22, 2016 11:17 AM

Worked perfectly!

Gobi M [Syncfusion]
Replied On June 23, 2016 01:04 AM

Hi Drew Wilson,  
Thanks for the update. 
Please let us know for any queries. 
Gobi M 

Drew Wilson
Replied On August 2, 2016 02:16 PM

I would like to further format this as currency by adding commas every 3 digits and two decimal places. Is it possible to do something like:

  <chart:DataMarkerLabelStyle LabelFormat ="$###,###.##"/>


Yuvaraj Palanisamy [Syncfusion]
Replied On August 3, 2016 10:17 AM

Hi Drew Wilson, 
We have prepared a sample as per your requirement. Please find the sample from the below location, 


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.

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.