ACKDateGrouperDelegate not working 2.9.0.6?


#1

I am trying out the Premium version but I cant get the date based sampling to work. Using other samplers work just fine! It is pretty unclear how the DateComponent object is used so maybe I did something wrong. But it doesn’t seem like it is working.

func createThinLineSeries()->SChartLineSeries {
let thinLine = SChartLineSeries()

    thinLine.style().lineColor = StyleHelper.tintColor()
    thinLine.style().lineWidth = 1
    thinLine.dataSampler = getSampler()
    return thinLine
}

func getSampler()-> SChartDataAdapter{
    var currentTimeSpan = DateComponents()
    currentTimeSpan.day = 7
    let grouper = ACKDateGrouperDelegate(timeSpan: currentTimeSpan, forXValues: true)
    return ACKAggregator(
        xAxisAnalyzer: ACKAverageAnalyzer(),
        yAxisAnalyzer: ACKMaximumAnalyzer(),
        grouperDelegate: grouper)
}

#2

Hi siper,

I’ve been using your provided sampler along with this datasource:

    double angle = (double)dataIndex / 100 * M_PI * 2;

    return [[SChartDataPoint alloc] initWithXValue:[NSDate dateWithTimeIntervalSince1970:dataIndex * 86400]
                                            yValue:@(sin(angle))];

And I see a sine wave, but with a straight line drawn, connecting points which occur every week (matching the 7 specified in your sampler).

Are you able to provide a working demo that shows the problem you’re having?

Thanks!
Rob


#3

I think I might have missunderstood how the dategrouper works. What I want to achieve is to be able to group my data into date ranges. In this case I wanted to display the max value for each week on the y axis. I guess this is not what the ACKDateGrouperDelegate is for and i should do my own calculations? (Which isn’t that hard)