Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
60
How would I setup the X Axis when plotting an array of doubles for a LineSeries in a XamDataChart
posted

I am using Infragistics version 14.1.

I am trying to bind and plot an array of doubles for a LineSeries in a XamDataChart.

I have no X Axis values and want equal distribution of the data points accross the X Axis.

I do not have to display the values on the X Axis but each of the values are 1ms apart if that helps.

How would I create the X Axis for this?

For now I am just trying to plot 10 values in the array (1 - 10) and set the scales to show 1 - 10 on the X Axis and 1 - 10 on the Y Axis.

Once I get it working I will have a couple thousand data points and I will need to adjust the scales for it to fit.

I am trying to bind this within XAML with no code behind.

Is it possible without any code behind?

                <ig:XamDataChart x:Name="curveChart" Background="White" Canvas.Left="10" Margin="0" Canvas.Top="284" Height="220" Width="264">
                    <ig:XamDataChart.Axes>
                        <ig:NumericYAxis x:Name="YAxis" MinimumValue="0" MaximumValue="10" Interval="1"></ig:NumericYAxis>
                        <ig:CategoryXAxis x:Name="XAxis" Label="{}{index}"></ig:CategoryXAxis>                        
                    </ig:XamDataChart.Axes>
                    <ig:XamDataChart.Series>
                        <ig:LineSeries Brush="Blue" ItemsSource="{Binding ElementName=outerControl, Path=WVAF[DataPoints]}"  
                            Title="Curve" MarkerType="None" Thickness="2"
                            XAxis="{Binding ElementName=XAxis}" 
                            YAxis="{Binding ElementName=YAxis}">                           
                        </ig:LineSeries>
                    </ig:XamDataChart.Series>
                </ig:XamDataChart>

  • 1500
    Offline posted

    Hello,

    XamDataChart requires a data object model to be mapped as its data context. In order to display an array of doubles, you will have to convert the array into a collection of label-value pair objects to which you can bind the label and ValueMemeberPath properties of the chart.

    Unless the array of doubles you will be getting is converted somewhere else, you will need to add code for this part.

    Should you have any other questions, please let me know.

    Sincerely,
    Tihomir Tonev
    Associate Software Developer
    Infragistics