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

Marker Position and Size

Thread ID:

Created:

Updated:

Platform:

Replies:

148060 Oct 3,2019 04:26 PM UTC Oct 4,2019 01:29 PM UTC Xamarin.Forms 1
loading
Tags: SfChart
Marcel Stirnimann
Asked On October 4, 2019 06:06 AM UTC

Is it somehow possible to place a marker (for example a triangle) with its tip and not its center to the coordinates?

How can i prevent that the marker keeps it's size when the axes are rescaling?

Geetha Rajendran [Syncfusion]
Replied On October 4, 2019 01:29 PM UTC

Hi Marcel, 
  
We have achieved your requirement by using the LabelTemplate property of ChartDataMarker. Please refer the below code. 
  
Code snippet [C#]: 
<ContentPage.Resources> 
    <ResourceDictionary> 
        <OnPlatform x:TypeArguments="x:String" x:Key="FontIcon"> 
            <On Platform="Android" Value="Segoe_MDL2_Assets.ttf#Segoe MDL2 Assets" /> 
            <On Platform="iOS" Value="/Assets/Segoe_MDL2_Assets.ttf#Segoe MDL2 Assets" /> 
            <On Platform="UWP" Value="Segoe MDL2 Assets"/> 
        </OnPlatform> 
    </ResourceDictionary> 
</ContentPage.Resources> 
  
. . . 
  
<chart:ColumnSeries x:Name="series" ItemsSource="{Binding Data}" XBindingPath="XValue" YBindingPath="Growth" > 
    <chart:ColumnSeries.DataMarker> 
        <chart:ChartDataMarker ShowMarker="False" > 
            <chart:ChartDataMarker.LabelStyle> 
                <chart:DataMarkerLabelStyle OffsetY="-9" LabelPosition="Inner" /> 
            </chart:ChartDataMarker.LabelStyle> 
            <chart:ChartDataMarker.LabelTemplate> 
                <DataTemplate> 
                    <Label Text="&#xE878;"  
                                   HorizontalTextAlignment="Center"  
                                   VerticalOptions="Center" 
                                   VerticalTextAlignment="Center" 
                                   HorizontalOptions="Start"  
                                   FontSize="25"  
                                   TextColor="White" FontFamily="{StaticResource FontIcon}"> 
                    </Label> 
                </DataTemplate> 
            </chart:ChartDataMarker.LabelTemplate> 
        </chart:ChartDataMarker> 
    </chart:ColumnSeries.DataMarker> 
</chart:ColumnSeries> 
  
  
Screenshot: 
 
  
Thanks, 
Geetha R. 


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.

Please sign in to access our forum

This page will automatically be redirected to the 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

Live Chat Icon For mobile
Live Chat Icon