Funnel Chart Label String Format

How can i format a label to currency "C2"?

Example:

<chart:SfChart.Series>
                    <chart:FunnelSeries ItemsSource="{Binding Data}" 
                                    XBindingPath="Status"
                                    YBindingPath="Valor"
                                    LabelFormat="C2"
                                    EnableTooltip="True"  />
                </chart:SfChart.Series>

1 Reply

PS Parthiban Sundaram Syncfusion Team October 16, 2017 12:36 PM UTC

Hi Daniel, 
   
Thanks for using Syncfusion products.      
      
You can achieve this requirement by setting a DataTemplate with an IValueConverter for data marker label and using ChartDataMarker.LabelTemplate property. Please refer the following code snippet for more details      
      
Code snippet:      
      
DateTemplate      
      
      
    <ResourceDictionary>      
     <local:DataMarkerConverter x:Key="labelConverter"></local:DataMarkerConverter>      
      <DataTemplate x:Key="LabelTemplate">      
        <StackLayout>      
            <Label Text="{Binding YValue, Converter={StaticResource labelConverter}"/>      
        </StackLayout>      
      </DataTemplate>      
    </ResourceDictionary>      
      
     
Converter     
      
      
        public object Convert(object value, Type targetType, object parameter, CultureInfoculture)      
        {      
            double yValue = System.Convert.ToDouble(value);  
            return yValue.ToString("C2", newCultureInfo("en-US"));  
     }      
     
We have created a simple demo sample to demonstrate this. Please download it from below location.        
      
  
Please let us know, if you need further assistance on this.     
  
Regards,    
Parthiban S 


Loader.
Up arrow icon