locked
Date Grouping - Last RRS feed

  • Question

  • I'm running into some puzzling results when grouping data with dates as the x-value.  When using "X:Last" it is returning the first day of the following period, instead of the last day of the grouped period.

    To illustrate, I created a simple program that generated one data point per month, then grouped it by quarters (3 months) into 3 different series: one for first, one for center and one for last.

    dm.Group("AVE, X:First", 3, IntervalType.Months, series, first);
    dm.Group("AVE, X:Center", 3, IntervalType.Months, series, center);
    dm.Group("AVE, X:Last", 3, IntervalType.Months, series, last);
    
    First           Center          Last			Expected Last
    1/1/2014        2/15/2014       4/1/2014		3/31/2014
    4/1/2014        5/16/2014       7/1/2014		6/30/2014
    7/1/2014        8/16/2014       10/1/2014		9/30/2014
    10/1/2014       11/16/2014      1/1/2015		12/31/2014

    As you can see, First and Center give the expected results, however, Last does not.  Is there something I'm missing?  Is this a bug with the library?  Also note, this behavior occurs when grouping data into weekly, monthly, quarterly and yearly periods.

    I could just subtract one from ever value; but that is extra working modifying every data point's x-value when it is something that should just be working.  I guess I could just migrate to Linq and group the data 'myself' but I'd like to utilizing the charting functions since it is simpler (one line) and built in....

    Thanks!



    • Edited by Minosha Monday, October 6, 2014 4:51 PM
    Monday, October 6, 2014 4:45 PM