Selecting a Line series

5 posts, 0 answers
  1. Earnest
    Earnest avatar
    6 posts
    Member since:
    Aug 2008

    Posted 20 Jul 2010 Link to this post

    Is there an event that I can register for (similiar to ItemClick) that would fire when a user clicks along a line series (i.e. along the interpolated line)? I have a chart with a line series that is in a zoomable and scrollable chart. When the user clicks the line series I would like to show some properties for it. I am not showing pointmarks so the user would more naturally click on the line segments as oppose to at a particular data point.
  2. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 23 Jul 2010 Link to this post

    Hello Earnest,

    We do have such an event, it is in the ChartArea:
    this.radChart1.DefaultView.ChartArea.ItemClick += new EventHandler<ChartItemClickEventArgs>(ChartArea_ItemClick);

    Best,
    Joshua
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  3. Earnest
    Earnest avatar
    6 posts
    Member since:
    Aug 2008

    Posted 23 Jul 2010 Link to this post

    I can get the ItemClick event if I click on a point mark, but I want an event when I click along the line stroke as in the attached image. 

    I don't have point marks visible (furthermore I have removed them with a style to improve performance per this post ) so clicking the point marks is not possible nor would it make any since in my application (I am showing scientific data).

    I want to be able to identify when a user clicks the series so I can grab it and change its properties such as stroke color etc.

    Thanks
  4. Earnest
    Earnest avatar
    6 posts
    Member since:
    Aug 2008

    Posted 27 Jul 2010 Link to this post

    I understand that most of what I want to accomplish is now built in but...

    I modified the Interactivity example provided. The thing that was tripping me up is that I thought that the interactivity would still work if I turned on zooming and scrolling. I have pasted the modified code below. Notice that if you uncomment the two lines in the constructor you no longer get the selection behavior. (You can still toggle selection using the legend). Is there any plan to allow the interactivity with zoom and scroll enabled?

    Also, how can I get a list of currently selected series?

    Can we have the ability to set the selectionscope for the series as well, meaning, allow the option to have a single series selected at one time or multiple. I can seem to do it for items but not series.

    Thanks

    public Example()
            {
                InitializeComponent();
     
                RadChart1.DefaultView.ChartTitle.Content = "Sales Report";
                RadChart1.DefaultView.ChartLegend.Header = "Northwind";
     
                // if you uncomment these lines, you no longer get interactivity from the chart
                //////////RadChart1.DefaultView.ChartArea.ZoomScrollSettingsX.ScrollMode = ScrollMode.ScrollAndZoom;
                //////////RadChart1.DefaultView.ChartArea.ZoomScrollSettingsY.ScrollMode = ScrollMode.ScrollAndZoom;
     
                SeriesMapping sm = new SeriesMapping();
                sm.LegendLabel = "Beverages";
                sm.ItemMappings.Add(new ItemMapping("Y4", DataPointMember.YValue));
                SeriesDefinition definition = new LineSeriesDefinition();
     
                //definition.InteractivitySettings.HoverScope = InteractivityScope.Series;
                definition.InteractivitySettings.SelectionScope = InteractivityScope.Series;
                sm.SeriesDefinition = definition;
                RadChart1.SeriesMappings.Add(sm);
     
                SeriesMapping sm2 = new SeriesMapping();
                sm2.LegendLabel = "Dairy Products";
                sm2.ItemMappings.Add(new ItemMapping("Y5", DataPointMember.YValue));
                SeriesDefinition definition2 = new LineSeriesDefinition();
                //definition2.InteractivitySettings.HoverScope = InteractivityScope.Series;
                definition2.InteractivitySettings.SelectionScope = InteractivityScope.Series;
                sm2.SeriesDefinition = definition2;
                RadChart1.SeriesMappings.Add(sm2);
                            
     
                RadChart1.ItemsSource = DataObject.GetData();
            }
  5. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 29 Jul 2010 Link to this post

    Hello Earnest,

    Thank you for contacting us. We are aware of the issue with Zooming & Scrolling. The fix is under development.

    With the SP1 release we plan on extending the interactions API to allow further flexibility and ease of use.

    In the official release, however, such an API is missing.

    Best,
    Joshua
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
Back to Top