hi ,
i am newer to xamdatachart so i want sample code for developing for crosshair for interpolated data in xamdatachart ,
if anybodies having idea about xamdatachart plz give me some sample
whether crosshair is possible to do in xamdatachart if possible means give me some example ,if not means how can i achieve crosshair
in chart ,plz anybodies give me reply it's very urgent for me
thanks in advance
Hi, do you just mean turning on the crosshairs? Or do you mean displaying the axis values at the exact point of the crosshair?
Turning on the crosshairs is done through the CrosshairVisibility property on the XamDataChart.
If you want access to the closest item to the crosshair then you should look at the SeriesCursorMouseMove event on the chart.
If you want to get the exact axis values at each move of the crosshair, then you should look at these samples: http://community.infragistics.com/forums/p/41666/237218.aspx#237218
The chart does not natively expose that information to you yet.
Hope this helps!
-Graham
hi Graham ,
i don't want display the axis values at the exact point of the crosshair but i need all the values of axis where ever touches the crosshair in chart
plz help me it's very urgent
Madhusudan
hi Graham,
thanks for your reply and i added the samples from which u gave the link ,but i getting one below error in this line of xaml code
SeriesCursorMouseMove="Chart_SeriesCursorMouseMove"
"Error 1 'XamDataChartControl.XamDataChartHostControl' does not contain a definition for 'Chart_SeriesCursorMouseMove' and no extension method 'Chart_SeriesCursorMouseMove' accepting a first argument of type 'XamDataChartControl.XamDataChartHostControl' could be found (are you missing a using directive or an assembly reference?) "
and here i copied my xaml code
<
UserControl x:Class
="XamDataChartControl.XamDataChartHostControl"
xmlns
="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x
="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:igChart="clr-namespace:Infragistics.Windows.DataChart;assembly=Infragistics.Windows.DataVisualization.DataChart.v10.1"
xmlns:igCtrl="clr-namespace:Infragistics.Windows.Controls;assembly=Infragistics.Windows.DataVisualization.Controls.v10.1"
xmlns:igChart1="clr-namespace:Infragistics.Controls.Charts;assembly=InfragisticsWPF4.Controls.Charts.XamDataChart.v10.2"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable
="d"
>
<UserControl.Resources
<LinearGradientBrush x:Key="rscGradientBorder" StartPoint="0.0, 0.0" EndPoint
="0.0, 1.0">
<GradientStop Color="#FFFFFFFF" Offset
="0" />
<GradientStop Color="#c0c2c8" Offset
="0.75" />
<GradientStop Color="#e0e2e8" Offset
="1" />
</LinearGradientBrush
<LinearGradientBrush x:Key="rscGradientBackground" StartPoint="0.0, 0.0" EndPoint
="1.0, 1.0">
="0.4" />
<Style x:Key="rscXamDataChartStyle" TargetType
="igChart:XamDataChart">
<Setter Property="PlotAreaBackground" Value
="Transparent" />
<!--<Setter Property="VerticalZoombarVisibility" Value="Visible"/>
<Setter Property="HorizontalZoombarVisibility" Value="Visible"/>-->
</Style
<Style x:Key="LegendStyle" TargetType="{x:Type igChart:Legend
}">
<Setter Property
="Background">
<Setter.Value
<LinearGradientBrush EndPoint="0,1" StartPoint
="0,0">
<GradientStop Color="White" Offset
="0.5" />
<GradientStop Color="#FFE8E8EF" Offset
</Setter.Value
</Setter
<!--<Setter Property="BorderBrush" Value="{DynamicResource rscGradientBorder}"/>-->
<Setter Property="BorderBrush" Value="{StaticResource rscGradientBorder
}"/>
<Setter Property="BorderThickness" Value
<Setter Property="Orientation" Value
="Vertical" />
<Setter Property="Padding" Value
="4" />
<Setter Property="Margin" Value
="2" />
="Template">
<!--<ControlTemplate TargetType="{x:Type igChart:Legend}">-->
<ControlTemplate TargetType
="igChart:Legend">
<Grid Margin="{TemplateBinding Margin
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="3" Background="Transparent" CornerRadius
="4">
<Grid Margin="{TemplateBinding Padding
<Grid.RowDefinitions
<RowDefinition Height
="Auto" />
="*" />
</Grid.RowDefinitions
<ContentPresenter Content="{TemplateBinding Content}" Margin="0" Grid.Row
<ScrollViewer BorderThickness="0" HorizontalScrollBarVisibility="Auto" Grid.Row="2" VerticalScrollBarVisibility="Auto" Margin
="3,0,0,0">
<ContentPresenter x:Name="ContentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" Grid.Row
</ScrollViewer
</Grid
</Border
<Border BorderBrush="Transparent" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="4" IsHitTestVisible
="False">
<Border.Background
<LinearGradientBrush EndPoint="0,1" Opacity="0" StartPoint
<GradientStop Color="Transparent" Offset
<GradientStop Color="#10FFFFFF" Offset
="0.499" />
="0.501" />
</Border.Background
</ControlTemplate
<!--<LinearGradientBrush x:Key="rscGradientBorder" StartPoint="0.0, 0.0" EndPoint="0.0, 1.0">
<GradientStop Color="#FFFFFFFF" Offset="0" />
<GradientStop Color="#c0c2c8" Offset="0.75" />
<GradientStop Color="#e0e2e8" Offset="1" />
</LinearGradientBrush>-->
</UserControl.Resources
<Border CornerRadius="5" Margin="5" Background="{StaticResource rscGradientBackground
<igChart:XamDataChart Grid.Row="1" Name="wpfWebDataChart1" Style="{StaticResource rscXamDataChartStyle
}"
Grid.Column="1" Legend="{Binding ElementName
=Legend}"
SeriesCursorMouseMove
="Chart_SeriesCursorMouseMove"
CrosshairVisibility="Visible"
<igChart:Legend igCtrl:XamDock.Edge="OutsideRight" x:Name="Legend"
Style="{DynamicResource LegendStyle
igCtrl:XamDock.VerticalAlignment="Center" Content
="Prices" />
<igChart:XamDataChart.Axes
<igChart:CategoryXAxis x:Name="XAxis" VerticalAlignment="Top" ItemsSource="{Binding }" Label
="{}{Column0}" />
<igChart:NumericYAxis x:Name="YAxis"
/>
</igChart:XamDataChart.Axes
<igChart:XamDataChart.Series
<igChart:LineSeries Title="High"
Legend="{Binding ElementName
XAxis="{Binding ElementName=XAxis}"
YAxis="{Binding ElementName=YAxis}" MarkerType
="None"
ItemsSource="{Binding }" ValueMemberPath
="Column2"
ToolTip
="{}{Series.Title} {Item.Column0:D}: {Item.Column2:C}" />
<igChart:LineSeries Title
="Low"
YAxis="{Binding ElementName
=YAxis}"
ItemsSource="{Binding }" ValueMemberPath="Column3"
="{}{Series.Title} {Item.Column0:D}: {Item.Column3:C}" />
="Close"
="Column4"
="{}{Series.Title} {Item.Column0:D}: {Item.Column4:C}" />
</igChart:XamDataChart.Series
</igChart:XamDataChart
</
UserControl
so plz tell me what i did mistake in that code and one more i didn't get the prrefix of local in this code
<igChart:XamDataChart SeriesCursorMouseMove="XamDataChart_SeriesCursorMouseMove" CrosshairVisibility="Visible"> <local:ChartBehaviors.CursorTooltip> <local:CursorTooltipBehavior TooltipTemplate="{StaticResource tooltipTemplate}" /> </local:ChartBehaviors.CursorTooltip>