Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
75
XamDataChart get current x axis value
posted

I have a chart with a OrdinalTimeXAxis and my chart is zoomable. i want to get current x axis values

<ig:OrdinalTimeXAxis x:Name="PreviewXAxis"
                                                     DateTimeMemberPath="."
                                                     ItemsSource="{Binding Path=DatesRange}"
                                                     Label="{}{Date:dd MMM yyyy}">
                                    <ig:OrdinalTimeXAxis.LabelSettings>
                                        <ig:AxisLabelSettings Location="OutsideBottom"
                                                              FontSize="10" />
                                    </ig:OrdinalTimeXAxis.LabelSettings>
</ig:OrdinalTimeXAxis>

Parents
No Data
Reply
  • 980
    Offline posted

    Hello,

    I guess you are looking for the currently visible labels of the XAxis after you have zoomed? If this is the case, what I can suggest is retrieving the HorizontalAxisLabelPanel:

    HorizontalAxisLabelPanel xPanel = Utilities.GetDescendantFromType(chart, typeof(HorizontalAxisLabelPanel), false) as HorizontalAxisLabelPanel;

    The panel will have a children collection of textblocks. You can loop trough it and check for the visible elements, as the textblocks which are left out of view will have their visibility set to collapsed.

    If this is not the case, please let me know.

    Sincerely,

    Tihomir Tonev
    Associate Software Developer
    Infragistics

Children