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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Looking for a good example to change and add dynamicly axis.

Thread ID:

Created:

Updated:

Platform:

Replies:

144797 May 23,2019 08:36 AM UTC May 23,2019 10:06 AM UTC WPF 1
loading
Tags: SfChart
Sascha
Asked On May 23, 2019 08:36 AM UTC

Hi Syncfusion Support!

We' re still evaluating your WPF Controls, specifically the sfchart. We' re a great fan of your examples to leverage our learnings. 

Do you have an example to change and add dynamically axis and bindings in C#?

Thank you very much!

regards, 
Sascha

Muneesh Kumar G [Syncfusion]
Replied On May 23, 2019 10:06 AM UTC

Hi Sascha, 
 
Greetings from Syncfusion.  
 
We have analyzed your requirement and we have prepared a sample based on that. We have updated the axis with already defined axis in resource as per the below code snippet.  
 
Code snippet 
  <Grid.Resources> 
            <chart:NumericalAxis x:Key="numerical"/> 
 
            <chart:CategoryAxis x:Key="category"/> 
 
            <chart:LogarithmicAxis x:Key="log"/> 
             
             
        </Grid.Resources> 
 
 
private void Button_Click(object sender, RoutedEventArgs e) 
        { 
            if(chart.SecondaryAxis is LogarithmicAxis) 
            chart.SecondaryAxis = grid.Resources["numerical"] as RangeAxisBase; 
            else 
                chart.SecondaryAxis = grid.Resources["log"] as RangeAxisBase; 
        } 
 
You can axis with series as per the below code snippet.  
 
Code snippet 
private void Button_Click_1(object sender, RoutedEventArgs e) 
        { 
            FastColumnBitmapSeries series = new FastColumnBitmapSeries(); 
            series.XBindingPath = "XValue"; 
            series.YBindingPath = "YValue"; 
            series.ItemsSource = viewModel.Data; 
            series.YAxis = new NumericalAxis(); 
 
            chart.Series.Add(series); 
        } 
 
 
Please refer below user documentation for more details about axis types and customization.  
 
 
Please let us know if you have any queries.  
 
Regards, 
Muneesh Kumar G. 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon