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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Chart axis label posibility

Thread ID:

Created:

Updated:

Platform:

Replies:

132513 Sep 6,2017 05:51 AM UTC Sep 11,2017 04:37 AM UTC Xamarin.Forms 3
loading
Tags: SfChart
Samir Asaf
Asked On September 6, 2017 05:51 AM UTC

Hi,
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 12:06 PM UTC

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.  
  
Regards,
Parthiban S
 
 


Samir Asaf
Replied On September 8, 2017 04:15 AM UTC

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


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

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.

Regards,
Parthiban S



CONFIRMATION

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.

Warning Icon 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.Close Icon

;