In the below xaml code the IsTabStop is set to false for the chart and series, but when tab key is pressed the tab navigation is still allowed on the chart and the series.
<ig:XamDataChart Background="White" Name="xamDataChart1" IsTabStop="False"> <ig:XamDataChart.Series> <ig:SplineSeries ValueMemberPath="Value" IsTabStop="False" x:Name="Series2" ItemsSource="{Binding Data2}" XAxis="{Binding ElementName=firstXAxis}" YAxis="{Binding ElementName=theYAxis}" /> <ig:SplineSeries ValueMemberPath="Value" IsTabStop="False" x:Name="Series1" ItemsSource="{Binding Data}" XAxis="{Binding ElementName=firstXAxis}" YAxis="{Binding ElementName=theYAxis}" /> </ig:XamDataChart.Series> </ig:XamDataChart>
Is there a way to handle the taborder index for the chart and series considering the option that the data for the series is fetched from database and binded in the codebehind?
Option to disable the tab navigation from code behind when not required?
e.g. xamDataChart1.IsTabStop = false; Series1.IsTabStop = false;Series2.IsTabStop = false;
Hello Prasad,
Thank you for your post! I have been researching your issue and have created small sample for you, named xamDataChartIsTabStop. In the sample I use the code snipped you have sent in your e-mail. What I can suggest is to set the IsTabStop property of the CategoryX and NumericY Axes to false too. Also you can create a style for the markers of the series and set the IsTabStop property for them too.
I have implemented this approach in the attached sample for you.
Please refer to the attached sample and feel free to let me know if you have any further questions on the matter.
Hello Gergana,
How can I completely disable the TabNavigation on the ChartControl at one instance rather than setting this at each level like CategoryX and NumericY and then setting the markers of the series?
Thanks and Regards,
Prasad
Thanks for your response and the sample was very helpful.The above solution works and below is the modified code. I need few more clarifications on this.
private void BindLineSeriesData() { LineSeries series; List<LineSeries> serieCollection =new List<LineSeries>(); this.myChartControl.DataChart = new XamDataChart(); this.myChartControl.DataChart.Padding = new Thickness(10.0); this.myChartControl.DataChart.VerticalZoomable = true; this.myChartControl.DataChart.HorizontalZoomable = true; this.myChartControl.DataChart.HorizontalAlignment = HorizontalAlignment.Stretch; this.myChartControl.DataChart.VerticalAlignment = VerticalAlignment.Stretch; this.myChartControl.DataChart.VerticalZoombarVisibility = Visibility.Visible; this.myChartControl.DataChart.HorizontalZoombarVisibility = Visibility.Visible; this.myChartControl.DataChart.Opacity = Convert.ToDouble(txtOpacity.Text); this.myChartControl.IsTabStop = false; this.myChartControl.DataChart.IsTabStop = false; ChartData dataSample = GetChartDataList();
NumericYAxis nyAxis = new NumericYAxis(); CategoryXAxis cxAxis = new CategoryXAxis();
Style mstyle = new Style { TargetType = typeof(Marker) }; mstyle.Setters.Add(new Setter(Marker.IsTabStopProperty, false)); nyAxis.MinimumValue = 0; nyAxis.Interval = 200; cxAxis.ItemsSource = dataSample; cxAxis.Label = "{Country}"; nyAxis.IsTabStop = false; cxAxis.IsTabStop = false;
this.myChartControl.DataChart.Axes.Add(cxAxis); this.myChartControl.DataChart.Axes.Add(nyAxis);
series = new LineSeries(); series.ValueMemberPath = "Coal"; series.Title = "Coal"; series.XAxis = cxAxis; series.YAxis = nyAxis; series.MarkerStyle = mstyle; series.Legend = myChartControl.legend; series.ToolTip = myChartControl.ShowToolTip("Item.Coal", "Coal"); series.ItemsSource = dataSample; serieCollection.Add(series);
series = new LineSeries(); series.ValueMemberPath = "Oil"; series.Title = "Oil"; series.XAxis = cxAxis; series.YAxis = nyAxis; series.MarkerStyle = mstyle; series.Legend = myChartControl.legend; series.ToolTip = myChartControl.ShowToolTip("Item.Oil", "Oil"); series.ItemsSource = dataSample; serieCollection.Add(series);
series = new LineSeries(); series.ValueMemberPath = "Gas"; series.Title = "Gas"; series.XAxis = cxAxis; series.YAxis = nyAxis; series.MarkerStyle = mstyle; series.Legend = myChartControl.legend; series.ToolTip = myChartControl.ShowToolTip("Item.Gas", "Gas"); series.ItemsSource = dataSample; serieCollection.Add(series);
this.myChartControl.ShowChart<LineSeries>(serieCollection); }
I have the following issues:1. Is there a way to set the IsTabStop to false for the Vertical and Horizontal zoombar as the tab navigation is still allowed on the zoom bars.2. The Legend items within the legend also allow the tab navigation.Settings series.Legend.IsTabStop=false; doesnot work.
I have the ContentControl with a Grid containing the XamDataChart in the Usercontrol.
As a temporary solution setting the contentcontrol istabstop to false will not allow the tab navigation within the legend items, but I'm not quite happy with this solution. Is there any direct solution to set IsTabStop on legend similar to the MarkerStyle set on series.<ContentControl.Resources> <Style TargetType="ContentControl"> <Setter Property="IsTabStop" Value="false"/> </Style></ContentControl.Resources>