Scatter Line Chart with X and Y value binding with Logarithmic axis

2 posts, 0 answers
  1. sandeep
    sandeep avatar
    6 posts
    Member since:
    Jun 2014

    Posted 11 Nov 2014 Link to this post

    Hi,

    I need some code which can render a Scatter line plot with x and y value and both the axis are logarithmic.

    Thanks & Regards,
    Sandeep Kumar Vidiyala
  2. Martin
    Admin
    Martin avatar
    1101 posts

    Posted 13 Nov 2014 Link to this post

    Hi Sandeep,

    You can take a look at the Scatter Series and the LogarithmicAxis SDK Examples as a reference for creating an example with ScatterSeries and two logarithmic axes.

    I also prepared few snippets demonstrating such data binding scenario.

    <telerik:RadCartesianChart>         
        <telerik:RadCartesianChart.VerticalAxis>
            <telerik:LogarithmicAxis/>
        </telerik:RadCartesianChart.VerticalAxis>
        <telerik:RadCartesianChart.HorizontalAxis>
            <telerik:LogarithmicAxis/>
        </telerik:RadCartesianChart.HorizontalAxis>
     
        <telerik:ScatterLineSeries ItemsSource="{Binding}" XValueBinding="XValue" YValueBinding="YValue" />
    </telerik:RadCartesianChart>

    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
     
            var source = new ObservableCollection<DataItem>()
            {
                new DataItem() { XValue = 10, YValue = 1000000 },
                new DataItem() { XValue = 100, YValue = 100000 },
                new DataItem() { XValue = 1000, YValue = 10000 },
                new DataItem() { XValue = 10000, YValue = 1000 },
                new DataItem() { XValue = 100000, YValue = 100 },
                new DataItem() { XValue = 1000000, YValue = 10 },
            };
            this.DataContext = source;
        }
    }
     
    public class DataItem
    {
        public double XValue { get; set; }
        public double YValue { get; set; }
    }

    I hope this helps.

    Regards,
    Martin
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top