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

Changing axis values without rendering of the SfChart

Question 1:

I have a chart of 100K points that display a sine wave, xAxis value show the number of points (between 0 to 99999).

I would like to know if I can change the xAxis values with a mathematical equation so that the chart will remain the same (same proportion as well) but the values would change and that I won't need to render the chart from the beginning.

Let say multiply all xAxis by 10.

Is it possible?



Question 2:

Is it possible to add another NumericalAxis as a PrimaryAxis, so there will be 2. Both axis will be shown one above the other?


Regards,

Dov.

5 Replies

DA Devi Aruna Maharasi Murugan Syncfusion Team November 22, 2016 10:01 AM UTC

Hi Dov, 
  
Thanks for Contacting Syncfusion Support 
 
Query 1: XAxis values would change and that I won't need to render the chart from the beginning.  
 
We are able to achieve your requirement by enabling the ListenPropertyChange property of series. When we are enabling the ListnPropertyChange property, chart will listen to the property changes of its underlying data object and it can be set as shown in below code snippet, 
  
 
            <chart:FastLineBitmapSeries ListenPropertyChange="True"> 
                                                                      
            </chart:FastLineBitmapSeries> 
 
 
  
We have prepared a demo sample based on this requirement and it can be downloaded from below link, 
  
Sample: SineWave 
  
Query 2: Is it possible to add another NumericalAxis as a PrimaryAxis 
  
We are able to achieve this requirement by defining the XAxis property of series as shown in the below code snippet, 
 
 
           <chart:FastLineBitmapSeries> 
 
                <chart:FastLineBitmapSeries.XAxis> 
                    <chart:NumericalAxis /> 
                </chart:FastLineBitmapSeries.XAxis> 
 
            </chart:FastLineBitmapSeries> 
 
  
Please refer our UG documentation link to know more about defining multiple axes 
  
Regards, 
Devi 


  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  



DO Dov November 22, 2016 10:55 AM UTC

Thank you for your fast reply.

In question 1 I've meant to skip on the part that you loop on the data and change it.
I wanted to change the axis values without the need to run on all the data.
I'm guessing it's not possible - just wanted to be sure.


I probably missed the "Multiple Axes" part in SfChart Axis - thank you for the link, I'll check it out.

Regards,

Dov.


DA Devi Aruna Maharasi Murugan Syncfusion Team November 23, 2016 11:45 AM UTC

Hi Dov, 
  
Thanks for your update. 
  
We are able to change only the axis labels by defining CustomLabels for axis. In order to generate custom labels, we have to bind a collection to LabelsSource property of axis, which defines the content and position for the axis labels and it can be set as below code snippet, 
 
          <chart:FastLineBitmapSeries > 
                <chart:FastLineBitmapSeries.XAxis> 
                    <chart:NumericalAxis  LabelsSource="{Binding Labels}"  
                                          ContentPath="Content"  
                                          PositionPath="XValue" /> 
                </chart:FastLineBitmapSeries.XAxis> 
          </chart:FastLineBitmapSeries> 
  
Sample: SineCustomLabel 
  
Please refer our UG documentation link to know more about custom labels 
  
You can also edit the label content when the labels get created with LabelCreated event of axis and to know about the LabelCreated event, please refer the below UG documentation link, 
  
  
Regards, 
Devi 






DO Dov November 23, 2016 12:45 PM UTC

Great, thank you very much.


DA Devi Aruna Maharasi Murugan Syncfusion Team November 24, 2016 03:38 AM UTC

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


Loader.
Live Chat Icon For mobile
Up arrow icon