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

Adding text to DataMarker

Thread ID:





124670 Jun 21,2016 07:04 PM UTC Aug 3,2016 02:17 PM UTC Xamarin.Forms 5
Tags: SfChart
Drew Wilson
Asked On June 21, 2016 07:04 PM UTC

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 12:43 PM UTC

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 03:17 PM UTC

Worked perfectly!

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

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

Drew Wilson
Replied On August 2, 2016 06:16 PM UTC

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 02:17 PM UTC

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.

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