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
2085
CategoryDateTimeXAxis Dynamic Lables
posted

I am looking to a solution to this post that uses CategoryDateTimeXAxis:

http://ko.infragistics.com/community/forums/t/52624.aspx

The example works but, unfortunately, CategoryXAxis requires all series on the chart to have all x-values "aligned", so if I have two series that do not have completely matching times for the x-axis data, the second series will not be rendered (see http://ko.infragistics.com/community/forums/p/38082/220246.aspx).  I tried to drop in a CategoryDateTimeXAxis in the example since it allows "non-aligned" x-values but that doesn't work - for example, simply changing this:

<igChart:CategoryXAxis x:Name="xAxis" ItemsSource="{StaticResource data}">

to this:

<igChart:CategoryDateTimeXAxis x:Name="xAxis" ItemsSource="{StaticResource data}" DateTimeMemberPath="Date">

does not work.  Any suggestions on how to alter the referred posts' example for this type of X-Axis?

Parents
No Data
Reply
  • 34810
    Offline posted

    Hello Gary,

    Thank you for your post!

    I have been investigating into this issue, and it appears that with the current bindings on the DateLabel object that now represents the CategoryDateTimeXAxis's Label, you should be getting a large amount of binding expression errors in the Visual Studio output window. This is being caused due to the ElementName binding to find the Chart property of the DateLabel object. To get around this, rather than using an ElementName binding, you can use the following: {Binding Axis.Chart}.

    The above fixes the binding errors, but the labels still do not render. This appears to be a timing issue with the XamDataChart and the axis being created, but I am not entirely sure as of yet. One thing that is rather disturbing about this is that the GetDateLabels() method on the DateLabel class is now returning the correct number of DateLabel objects, but each of their Date properties is set to 1/1/0001. This is also causing the AxisScale to always be returned as "Minutes" as well, which isn't correct. At the start, it should be "Years".

    I am going to continue to investigate this to see what is going on here. To use this with the CategoryDateTimeXAxis, it currently appears that a different custom object may need to be constructed. I will update this forum thread again when I have more information for you.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer
    Infragistics Inc.
    www.infragistics.com/support

Children