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

How to add the icons on top of each column/bar segment in Xamarin.Forms Chart?

You can add icon at the top of each bar segment by setting DataTemplate for DataMarker with an IValueConverter to the LabelTemplate property.

The following code sample and output demonstrates how to add an icon at the top of each bar segment and you can download the complete sample here.


            <local:ChartImageConverter x:Key="imageConverter"></local:ChartImageConverter>
            <DataTemplate x:Key="icon">
                    <Image x:Name="image" Source="{Binding YValue, Converter={StaticResource imageConverter}}" WidthRequest="20" HeightRequest="20"/>
<chart:ColumnSeries ItemsSource="{Binding SeriesData}" XBindingPath="XValue" YBindingPath="YValue">
                    <chart:ChartDataMarker ShowLabel="True" LabelTemplate="{StaticResource icon}">
                            <chart:DataMarkerLabelStyle LabelPosition="Inner"/>


public class ChartImageConverter : IValueConverter
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
            if (System.Convert.ToDouble(value) < 0)
                return "Down.png";
                return "Up.png";
        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
            return value;


Chart with icons placed on top of it's bar segments in Xamarin.Forms

2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

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

Up arrow icon

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

Live Chat Icon For mobile