Xamarin - Datapoint value is rounding decimal place


I am passing a value of 0.07 to a SChartLineSeries chart, but the label shows a value of 0.1. What do I set to make sure the values are not rounded



Hi theresa,

I may need a little more information, however it is possible that it’s a label formatting issue. Have you tried using SChartTickLabelFormatter to format your values to two decimal places (or however many you need)?

If that doesn’t work, could you let me know how many datapoints you have in your chart and perhaps post a screenshot of what you’re currently seeing?

Many thanks,



Hi Sam, are there any examples for scharticklabelformatter in c#? This should read 0.07






Hi theresa,

You should be able to create an SChartTickLabelFormatter and then set its formatter property to an NSNumberFormatter (here’s the Xamarin link to the documentation).

You should be able to set MinimumFractionDigits to 2 (or however many digits you’d like to display after the decimal point).

If that doesn’t work and you have multiple datapoints you may have to set the major tick frequency.

I hope that’s of some help :smile:,



Hi Sam, I was actually able to solve this issue by using this :

chart.YAxis.LabelFormatString = "%0.2f%";

seemed to have done the trick



I followed your apporach (look below code) as well as Theresa’s approach. Both cases, even for numbers 100, it is drawing 100.00.

I only want decimals for decimal numbers only. suppose i have two datapoints in the chart 100 and 121.34. I want 100 to be drawn as 100, but 121.34 as 121.34

How do i do that? Please help

if(numberFormatter == nil){
        numberFormatter = [[NSNumberFormatter alloc] init];
        numberFormatter.numberStyle = NSNumberFormatterDecimalStyle;
        numberFormatter.minimumFractionDigits = 2;
    if(tickLabelFormatter == nil){
        tickLabelFormatter = [[SChartTickLabelFormatter alloc] init];
        [tickLabelFormatter setFormatter:numberFormatter];
    self.schart.yAxis.labelFormatter = tickLabelFormatter;


Never mind. found the anser

If you want the following

100 => 100

100.000 => 100

43.567 => 43.56

then use

numberFormatter.maximumFractionDigits = 2;


Glad to hear you sorted it!