ChartView : How to Navigate/Move DataPoint Selection using Keyboard Right,Left

3 posts, 0 answers
  1. Sivakumar
    Sivakumar avatar
    27 posts
    Member since:
    Dec 2015

    Posted 06 Jan Link to this post

    My Requirement to move Datapoint selection using keyboards right,left arrow keys.I am already highlight datapoints using selection changed event.But How to navigate the point? 

    Please see attached... 


  2. Sivakumar
    Sivakumar avatar
    27 posts
    Member since:
    Dec 2015

    Posted 06 Jan in reply to Sivakumar Link to this post

    <telerik:RadCartesianChart Height="1"  Palette="Arctic" >
                   <telerik:CategoricalAxis VerticalLocation="Top" Visibility="Visible" LabelFitMode="None" LabelRotationAngle="-90"  />
                   <telerik:LinearAxis  Minimum="-1" Maximum="2" MajorStep="1"  MajorTickOffset="5" ElementBrush="Orange" />
                           <telerik:CategoricalDataPoint Value="1"/>
                           <telerik:CategoricalDataPoint Value="0" />
                           <telerik:CategoricalDataPoint Value="1" />
                           <telerik:CategoricalDataPoint Value="1" />
                           <telerik:CategoricalDataPoint Value="1"/>
                           <telerik:CategoricalDataPoint Value="1" />
                           <telerik:CategoricalDataPoint Value="0" />
                           <telerik:CategoricalDataPoint Value="0"/>
                           <DataTemplate >
                                   <!--Fill="{Binding Presenter, Converter={StaticResource SeriesToPaletteColorConverter}}"-->
                                   <Rectangle Height="126"  Width="10"     Stroke="Transparent" Fill="Red"  />
                                   <DataTrigger  Value="1"  Binding="{Binding Index}" >
                                       <Setter Property="Opacity" Value="0.01" />
                    <telerik:ChartPanAndZoomBehavior ZoomMode="Horizontal" PanMode="Horizontal"   />
                    <telerik:ChartSelectionBehavior DataPointSelectionMode="Single"
  3. DevCraft banner
  4. Martin
    Martin avatar
    1052 posts

    Posted 08 Jan Link to this post

    Hi Sivakumar,

    This behavior is not supported by RadChartView. However, you can achieve your requirement by subscribing for the KeyDown event of the chart and inside its handler change the selected item. To do this, you can get the currently selected item and its index in the DataPoints collection of the series and increment the index with 1 or -1 (based on the pressed key). Then get the data point positioned on the new index and set its IsSelected property to true.

    You can take a look at the attached project which contains sample implementation of this approach. But please keep in mind that this is customization and it is not well tested. So, I cannot guarantee that it will work in all expected cases. This is why I recommend you to test it properly if you decide to use it in production.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top