axisx tickpoints to visual tree

6 posts, 1 answers
  1. David Ocasio
    David Ocasio avatar
    147 posts
    Member since:
    Nov 2009

    Posted 01 Apr 2011 Link to this post

    Is there a way to get the AxisLabel2D that is assoicated with a particulart tickpoint on the xaxis.

    For example to change the foreground color (highlight) on demand ,
    (when a user select a particular datapoint or  when the code needs to default select a particular datapoint)

    thanks
    dco
  2. David Ocasio
    David Ocasio avatar
    147 posts
    Member since:
    Nov 2009

    Posted 01 Apr 2011 Link to this post

    Ok so i found a way but its fairly convoluted
    There must be a better way ??
    Is there ?

    Dim Tickpoint As TickPoint = Chartarea.AxisX.TickPoints.Where(Function(tp) tp.Label.Equals(Xcategory)).FirstOrDefault
    If Tickpoint IsNot Nothing Then
        Dim AxisLabel2D As AxisLabel2D = Chartarea.ChildrenOfType(Of AxisLabel2D).Where(Function(d2) d2.DataContext Is Tickpoint).FirstOrDefault
        If AxisLabel2D IsNot Nothing Then
            AxisLabel2D.Foreground = New SolidColorBrush(Colors.Red)
        End If
    End If

    thanks
    dco
  3. DevCraft banner
  4. Answer
    Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 06 Apr 2011 Link to this post

    Hi David Ocasio,

    RadChart exposes two properties for axis styling customization (AxisElementBrush that sets the color for line, tick elements and AxisForeground that sets the color for all labels) but if you need to customize individual axis elements, you will need to use the approach with the ChildrenOfType(...) method.


    Kind regards,
    Giuseppe
    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
  5. David Ocasio
    David Ocasio avatar
    147 posts
    Member since:
    Nov 2009

    Posted 06 Apr 2011 Link to this post

    well i thought as much,

    yes i am looking to change the style on a particular axis label (single point) when it is selected.

    it would be nice to have a built in method or reference instead of searching the tree.
    but it still works.

    thanks Giuseppe for your help.
    dco
  6. Ramya
    Ramya avatar
    27 posts
    Member since:
    Jan 2011

    Posted 28 Apr 2011 Link to this post

    I have a requirement to select a particular   datapoint selection on demand can u plz provide  me the code
  7. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 03 May 2011 Link to this post

    Hi Ramya,

    To see more information alont the lines of the requested functionality, please refer to the following example:

    http://demos.telerik.com/silverlight/#Chart/Selection

    I hope this gets you started properly.

    Greetings,
    Yavor
    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
DevCraft banner