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
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