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. Image for the cookie policy date

Chart axis label posibility

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

3 Replies

PS Parthiban Sundaram Syncfusion Team 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
 
 



SA Samir Asaf September 8, 2017 04:15 AM UTC

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



PS Parthiban Sundaram Syncfusion Team 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



Loader.
Up arrow icon