Culture problem

Hi,

We have to switch languages dynamically in the app and we also need to handle some 'exotic' cultures like en_LU.

We use the override method for ViewForDataMarkerLabel and we got an issue on the format of the label.
The label is formatted by your library using a culture/locale we don't know about.

So we need to know which culture/locale was used by the chart component to format the data string, so that we can convert that string back to double using that same culture.

OR can we manually force a culture for the whole component instead of letting it use the default one ?

Best regards,

Anthony




1 Reply

PS Parthiban Sundaram Syncfusion Team October 20, 2017 12:22 PM UTC

Hi Anthony,

Thanks for using Syncfusion products.

We would like to inform you that, we have not defined any CultureInfo for DataMarkerLabel internally but by default it takes system CultureInfo. However, you can achieve this requirement with the help of CultureInfo. Please refer the following code snippet for more details.

Code Snippet:

 
  
public class CustomDelegate : SFChartDelegate  
    {  
  
        public override UIView ViewForDataMarkerLabel(SFChart chart, NSString label, nint index, SFSeries series)  
        {  
  
          var data = Convert.ToDouble(label, CultureInfo.CurrentCulture);            
           
           // or  
  
            var dataPoints = (series.ItemsSource as IList<ChartModel>);  
  
            var data1 = dataPoints[(int)index].YValue;  
  
            return base.ViewForDataMarkerLabel(chart, label, index, series);  
        }  
 
  
  

Please let us know, if you need further assistance on this.

Regards,
Parthiban S


Loader.
Up arrow icon