This is a migrated thread and some comments may be shown as answers.

axisx tickpoints to visual tree

5 Answers 56 Views
Chart
This is a migrated thread and some comments may be shown as answers.
David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
David Ocasio asked on 01 Apr 2011, 09:09 PM
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

5 Answers, 1 is accepted

Sort by
0
David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 02 Apr 2011, 12:37 AM
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
0
Accepted
Giuseppe
Telerik team
answered on 06 Apr 2011, 01:59 PM
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
0
David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 06 Apr 2011, 02:52 PM
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
0
Ramya
Top achievements
Rank 1
answered on 28 Apr 2011, 01:44 PM
I have a requirement to select a particular   datapoint selection on demand can u plz provide  me the code
0
Yavor
Telerik team
answered on 03 May 2011, 07:33 AM
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
Tags
Chart
Asked by
David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
Answers by
David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
Giuseppe
Telerik team
Ramya
Top achievements
Rank 1
Yavor
Telerik team
Share this question
or