Adventures in plotting time-sensitive data points against a DateTimeCategoricalAxis

3 posts, 1 answers
  1. Paul
    Paul avatar
    5 posts
    Member since:
    Nov 2011

    Posted 02 Jan 2012 Link to this post

    I have recently been attempting to plot a series of data points on a Cartesian ChartView where each of the data points has a DateTime component.  The series of data points is spaced pretty regularly at one-minute intervals.  However, there are some gaps where there are no data points, and I didn't want the ChartView to leave gaps in these cases, so this meant that I needed a categorical axis for the horizontal axis; a DateTimeCategoricalAxis seemed to be a good choice for this.  The good news is that after several failed attempts at getting the data points to show up where I expected them, I got it to work by setting the DateTimeComponent property of the DateTimeCategoricalAxis to "Ticks".  However, this is the ONLY way that I've gotten it to work.  And something about this seemed a bit non-intuitive...

    It would seem to me that the default behavior when plotting data points (in which each references a DateTime which includes a time component) against an axis called a "DateTimeCategoricalAxis" would be that BOTH the date and time components would be considered and that the date AND time TOGETHER would be treated as a distinct value.  But this isn't the way it works by default.  Instead, it seems that the default behavior on this axis is for the Date component of the DateTime value to be used for grouping values, and the time portion is effectively ignored.  I understand that some assumption has to be made, but this doesn't seem to be the conservative assumption.  In light of this behavior, this axis might be more fittingly named a DateCategoricalAxis?  In the example above, I thought that specifying "Minute" for the DateTimeComponent would group things by minute -- effectively giving me no more than one data point per category, but instead, I got multiple data points spread across 60 minutes, because my data spanned multiple hours (and multiple days).  Request:  Would you please consider changing the default behavior of the DateTimeCategoricalAxis to group by "Ticks", so that the Date AND Time components of a DateTime are considered?


    I also tried out some of the other options for the DateTimeComponent of this axis.  Before using them, I thought I understood what they would probably do.  For example, I figured that using the Hour option would cause all data points which fell within the same hour of time (within the context of all larger units of time) to be grouped together (same X coordinate).  But after testing them I see I was wrong.  Instead of considering the unit of time in the context of larger units of time, the options consider a particular component of a datetime in isolation.  For example, there are only 24 hours in a day, so using the "Hour" option of the DateTimeComponent will only cause up to 24 categories to be created, and all data points will be plotted in one of those categories.  In all honesty, I can see the usefulness of such a feature, and now that I've used it it makes sense to me.  But I honestly think that it would be equally useful -- if not more so -- to support grouping of data points [on a DateTimeCategoricalAxis] by a contextualized date time component -- perhaps via a new boolean property that indicates that the DateTimeComponent property value is contextualized [to all larger units of time].  Request:  Could you please support some kind of contextualized date time component (as explained above)?

    So, there are my observations/thoughts/suggestions/requests as it pertains to the DateTimeCategoricalAxis.  Ultimately, I'm glad that setting the DateTimeComponent to "Ticks" gives me what I was after, but I'd also be glad to hear that you might consider the things I've mentioned here.

    Paul
  2. Answer
    Vladimir Milev
    Admin
    Vladimir Milev avatar
    1061 posts

    Posted 06 Jan 2012 Link to this post

    Hello Paul,

    Thank you for your detailed feedback. Indeed we agree with most of your reasoning. While our schedule for Q1 is already full, we will take your feedback into consideration and will see what we can do about changing some of the API.

    Your telerik points have been updated for taking the time to talk to us about our product and providing a thoughful response.


    Greetings,
    Vladimir Milev
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Paul
    Paul avatar
    5 posts
    Member since:
    Nov 2011

    Posted 06 Jan 2012 Link to this post

    Vladimir,

    Since I was just sharing my opinions on the matter, It's totally OK that you don't agree with all my reasoning.  I'm sure that the architects of the ChartView API have given much more careful thought to how and why things were done as they were.  But I really do appreciate you confirming that you (collectively) are willing take my feedback into consideration, since I feel that some of my points are certainly valid.  

    Regardless of what you do with my feedback, I look forward to any enhancements to the ChartView API.  Thanks again!


    Paul
Back to Top