LabelFormat of SfChart Axis is not working with "0.0;-0.0"

Using this label format when I have zero values, appears a "-" character next to 0. I verified that is not a negative value, is 0. On iOS it looks nice.


<xForms:NumericalAxis.LabelStyle >

<xForms:ChartAxisLabelStyle TextColor="DarkGray" LabelFormat="0.0;-0.0"/>

</xForms:NumericalAxis.LabelStyle>


How it looks on Android:

3.PNG


1 Reply

YP Yuvaraj Palanisamy Syncfusion Team July 10, 2021 04:55 PM UTC

Hi Rodrigo, 
 
Greetings from Syncfusion. 
 
We have checked your query and we have used the Java.Text.DecimalFormat for android and hence it returns the -0.0. We would like to suggest that to use LabelCreated event to resolve this. Please find the code example below. 
 
CodeSnippet: 
 
if(Device.RuntimePlatform == Device.Android) 
{ 
    numericalAxis.LabelCreated += NumericalAxis_LabelCreated; 
} 
 
private void NumericalAxis_LabelCreated(object sender, ChartAxisLabelEventArgs e) 
{ 
   if(e.LabelContent == "-0.0") 
    { 
        e.LabelContent = "0.0"; 
    } 
} 
 
Meanwhile we are validating this in our source level and please let us know if you have any concern. 
 
For more details, please refer the below link. 
 
Regards, 
Yuvaraj. 


Loader.
Up arrow icon