Hi,
I want to do some customization on the crosshair, the basic would be to only show the vertical line. But the crosshair layer does not show.
If I have an example code like this:
XAML:
<ig:XamDataChart x:Name="Chart" CrosshairVisibility="Visible"> <ig:XamDataChart.Axes> <ig:NumericXAxis x:Name="XAxis" /> <ig:NumericYAxis x:Name="YAxis" /> </ig:XamDataChart.Axes> <ig:XamDataChart.Series> <ig:ScatterSeries x:Name="Series1" XMemberPath="X" YMemberPath="Y" XAxis="{Binding ElementName=XAxis}" YAxis="{Binding ElementName=YAxis}" /> </ig:XamDataChart.Series> </ig:XamDataChart>
Code behind:
public MainWindow() { InitializeComponent(); this.Series1.ItemsSource = new Point[] { new Point(0, 0), new Point(5, 5) }; }
Then the crosshair layer will show as expected (without any customization):
But if I modify the XAML to have the crosshair layer:
<ig:XamDataChart x:Name="Chart"> <ig:XamDataChart.Axes> <ig:NumericXAxis x:Name="XAxis" /> <ig:NumericYAxis x:Name="YAxis" /> </ig:XamDataChart.Axes> <ig:XamDataChart.Series> <ig:ScatterSeries x:Name="Series1" XMemberPath="X" YMemberPath="Y" XAxis="{Binding ElementName=XAxis}" YAxis="{Binding ElementName=YAxis}" /> <ig:CrosshairLayer VerticalLineVisibility="Visible" HorizontalLineVisibility="Collapsed" /> </ig:XamDataChart.Series> </ig:XamDataChart>
The crosshair will not show:
How can I make the CrosshairLayer show, so I can add the customizations to it?
Thank you for helping
Hello Gin,
This may be an issue of the version of Infragistics for WPF that you are using, as if I use the same code you have provided, the CrosshairLayer is showing up.
The reason that I say it may be an issue of the version you are using is because in older versions, the CrosshairLayer only worked for “category” series, or the series types that require a CategoryXAxis/CategoryDateTimeXAxis.
Would it be possible for you to please provide some information on the version of Infragistics for WPF that you are using?
Thank you for helping. I'm using Infragistics Ultimate UI 19.1, NET framework 4.6.1