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.

Custom axis scale

Thread ID:

Created:

Updated:

Platform:

Replies:

126346 Oct 10,2016 07:06 AM Nov 6,2016 10:42 PM WPF 7
loading
Tags: SfChart
Thanh Tomas Dang
Asked On October 10, 2016 07:06 AM

Hello,

is it possible to extend ChartAxis to create a custom scale? What I specifically need is a square root scale, which is sadly not available for sfChart. What methods do I have to override to make this work?

Thank you,
Thanh

Devi Aruna Maharasi Murugan [Syncfusion]
Replied On October 11, 2016 03:26 AM

Hi Thanh, 
  
Thanks for contacting Syncfusion Support. 
  
We are able to achieve your requirement by overriding the GenearteVisibleLabels method with custom chart axis (SquareRootScale class). We have prepared a demo sample based on your requirement and it can be downloaded from below link, 
  
Sample: Squarerootaxis 
  
Regards, 
Devi 




Thanh Tomas Dang
Replied On October 11, 2016 04:12 AM

Hello Devi,

that's exactly what I needed. Thanks!

Thanh

Devi Aruna Maharasi Murugan [Syncfusion]
Replied On October 12, 2016 12:35 AM

Hi Thanh, 
  
Thanks for your update. 
  
Please let us know, if you need any further assistance. 
  
Regards, 
Devi 
 
 


Thanh Tomas Dang
Replied On October 28, 2016 03:53 PM

Hello Devi,

I reviewed the square root axis code and it seems like it does not do exactly what I need. 

In your last code example, you add the following:


            Collection.Add(new Model() { XValue = 1, YValue = 18 });
            Collection.Add(new Model() { XValue = 2, YValue = 32 });
            Collection.Add(new Model() { XValue = 3, YValue = 24 });
            Collection.Add(new Model() { XValue = 4, YValue = 42 });
            Collection.Add(new Model() { XValue = 5, YValue = 30 });

but the chart displays the Y values as square roots of 18, 32, 24, 42, 30.

What it should do is display the original values (18, 32, 24, 42, 30), but show the labels for 1, 4, 16, 25 on the Y axis accordingly.

If I may compare to logarithmic axis: At position 0 of the axis, the label shows 1 (log 0 = 1), at position 1, the axis shows 10 (log 10 = 1) and at position 2, the axis shows 100 (log 100 = 2).

Would re-scaling the axis (not just changing the labels!) be possible?

Thanks,
Thanh

Muneesh Kumar G [Syncfusion]
Replied On October 31, 2016 05:31 AM

Hi Thanh,  
   
We have modified our sample based on your requirement. Please find the modified sample from the below location. 
 
   
Please let us know, if you need any further assistance.  
   
Regards,  
Muneesh Kumar G. 


Thanh Tomas Dang
Replied On November 4, 2016 08:30 AM

Hello Muneesh, 

this works! Thank you for your help!

-Thanh

Devi Aruna Maharasi Murugan [Syncfusion]
Replied On November 6, 2016 10:42 PM

Hi Thanh, 
  
Thanks for your update. 
  
Please let us know, if you need any further assistance. 
  
Regards, 
Devi 


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.

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.

;