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.
Unfortunately, activation email could not send to your email. Please try again.

Chart axis label posibility

Thread ID:





132513 Sep 6,2017 01:51 AM Sep 11,2017 12:37 AM Xamarin.Forms 3
Tags: SfChart
Samir Asaf
Asked On September 6, 2017 01:51 AM

Is there a way to customize sfchart axis-labels to reproduce the same representation as shown in the image attached.

Attachment: Image1_b22523d6.zip

Parthiban Sundaram [Syncfusion]
Replied On September 7, 2017 08:06 AM

Hi Samir, 
You can able to achieve your requirement by using LabelCreated event in ChartAxis. Please refer the following code snippet for your reference. 
Code snippet: 
       privatevoid YAxis_LabelCreated(object sender, ChartAxisLabelEventArgs e) 
            double labelValue = Convert.ToDouble(e.LabelContent); 
            if (labelValue <= 2) 
                e.LabelContent = "VeryLow - " + e.LabelContent; 
            elseif (labelValue > 3 || labelValue <= 4) 
                e.LabelContent = "Low - " + e.LabelContent; 
            elseif (labelValue > 5 || labelValue <= 6) 
                e.LabelContent = "Medium - " + e.LabelContent; 
            elseif (labelValue > 7 || labelValue <= 8) 
                e.LabelContent = "High - " + e.LabelContent; 
            elseif (labelValue >= 9 || labelValue <= 10) 
                e.LabelContent = "VeryHigh - " + e.LabelContent; 
Please download the sample from following location. 
Please let us know, if you need further assistance on this.  
Parthiban S

Samir Asaf
Replied On September 8, 2017 12:15 AM

Hi, Thanks for the reply. The solution works really fine.

Parthiban Sundaram [Syncfusion]
Replied On September 11, 2017 12:37 AM

Hi Samir,

Thanks for the update. We are glad that the given solution has helped to achieve your requirement. Please let us know for your further assistance.

Parthiban S


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.

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.