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
120
xamdatachart crosshair
posted

So I am trying to work through the examples in the Infragistics.Samples.SL particularly the ChartCrossHair sample.

I pull the code to another solution and can't seem to get the cross hair to show.  The code is pretty much

the same, just pulled out to a different solution. I'm sure I'm making a simple

error but can't seem to get the cross hair to show.  I have included my xaml below.  Can someone help ?  Thanks

 

<UserControl x:Class="CrossHair.MainPage"

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

mc:Ignorable="d"

d:DesignHeight="300" d:DesignWidth="400"

xmlns:ig="http://schemas.infragistics.com/xaml"

xmlns:models="clr-namespace:CrossHair.Models;assembly=CrossHair">

<UserControl.Resources>

       <models:NumericDataModel x:Key="randomData1" d:IsDataSource="True" />

       <models:NumericDataModel x:Key="randomData2" d:IsDataSource="True" />

   </UserControl.Resources>

   

<Grid x:Name="LayoutRoot" Background="White">

       <Grid.RowDefinitions>

           <RowDefinition Height="1*" />

           <RowDefinition Height="1*" />

</Grid.RowDefinitions>

       

<ig:XamDataChart Name="xamDataChart1" Grid.Row="0"

                     CrosshairVisibility="Visible"

                       DataContext="{Binding Source={StaticResource randomData1}}" >

<!--#BEGIN SNIPPET#-->

           

<!-- ========================================================================== -->

           

<!-- Notice that this Crosshair behavior is implemented locally and you will need to copy it

            if you want to show only vertical or horizontal crosshairs otherwise both crosshairs will be displayed -->

           

<!-- ========================================================================== -->

           

<!-- ========================================================================== -->

           

<!--#END SNIPPET#-->

           

<ig:XamDataChart.Axes>

               

<ig:CategoryXAxis x:Name="xAxis" ItemsSource="{Binding Data}">

                   

<ig:CategoryXAxis.LabelSettings>

                       

<ig:AxisLabelSettings Visibility="Collapsed" />

                   

</ig:CategoryXAxis.LabelSettings>

               

</ig:CategoryXAxis>

               

<ig:NumericYAxis x:Name="yAxis" >

                   

<ig:NumericYAxis.LabelSettings >

                       

<ig:AxisLabelSettings Visibility="Collapsed" />

                   

</ig:NumericYAxis.LabelSettings>

               

</ig:NumericYAxis>

           

</ig:XamDataChart.Axes>

           

<ig:XamDataChart.Series>

               

<ig:LineSeries ItemsSource="{Binding Data}"

                             

Brush="Blue"

                             

MarkerType="None"

                             

XAxis="{Binding ElementName=xAxis}"

                             

YAxis="{Binding ElementName=yAxis}"

                             

ValueMemberPath="Y" />

           

</ig:XamDataChart.Series>

       

</ig:XamDataChart>

       

<ig:XamDataChart Name="xamDataChart2" Grid.Row="1"

                       

DataContext="{Binding Source={StaticResource randomData2}}"

                       

CrosshairVisibility="Visible" >

           

<!--#BEGIN SNIPPET#-->

           

<!-- ========================================================================== -->

           

<!-- ========================================================================== -->

           

<!--#END SNIPPET#-->

           

<ig:XamDataChart.Axes>

               

<ig:CategoryXAxis x:Name="xAxis2" ItemsSource="{Binding Data}">

                   

<ig:CategoryXAxis.LabelSettings>

                       

<ig:AxisLabelSettings Visibility="Collapsed" />

                   

</ig:CategoryXAxis.LabelSettings>

               

</ig:CategoryXAxis>

               

<ig:NumericYAxis x:Name="yAxis2" >

                   

<ig:NumericYAxis.LabelSettings >

                       

<ig:AxisLabelSettings Visibility="Collapsed" />

                   

</ig:NumericYAxis.LabelSettings>

               

</ig:NumericYAxis>

           

</ig:XamDataChart.Axes>

           

<ig:XamDataChart.Series>

               

<ig:LineSeries ItemsSource="{Binding Data}"

                             

Brush="Red"

                             

MarkerType="None"

                             

XAxis="{Binding ElementName=xAxis2}"

                             

YAxis="{Binding ElementName=yAxis2}"

                             

ValueMemberPath="Y" />

           

</ig:XamDataChart.Series>

       

</ig:XamDataChart>

   

</Grid>

</UserControl>