Candlestick with seconds data interval


Hi, i try to built candlestick chart in my apps, while the data for OHLC(open, high, low, close) is on seconds, is there someone know or can give me a for the xlabels? I already  here’s some of my code, and this is the result of the graph, not just like i’m expected. Thanks for any feedback.

  • (id<SChartData>)sChart:(ShinobiChart *)chart dataPointAtIndex:(int)dataIndex forSeriesAtIndex:(int)seriesIndex {


    SChartMultiYDataPoint *multiDP = [SChartMultiYDataPointnew];

    SChartDataPoint *dp = [SChartDataPointnew];


    // Map our data for our chart

    NSArray *p = [[_stockData data] objectAtIndex:dataIndex];

    NSString *jam = [p objectAtIndex:0];

    NSString *test = [jam substringWithRange:NSMakeRange(21, 8)];

      multiDP.xValue = test;//[dateFormatter dateFromString:test];


        dp.xValue = test;//[dateFormatter dateFromString:test];



    if (seriesIndex == 0) {

        NSString *a = [p objectAtIndex:5];

        NSString *tempvol = [a stringByReplacingOccurrencesOfString:@"]“withString:@”"];

        NSNumber *vol = [numberFormatter numberFromString:tempvol];

        dp.yValue = [NSNumbernumberWithFloat:vol.floatValue/1000.f]; // 1000000.f];


       // NSNumber *vol = [numberFormatter numberFromString:[p objectAtIndex:5]];

       // dp.yValue = [NSNumber numberWithFloat:vol.floatValue / 1000000.f];

        return dp;

    } else if (seriesIndex == 1) {

        [multiDP.yValuessetValue:[numberFormatternumberFromString:[p objectAtIndex:2]] forKey:@“High”];

        [multiDP.yValuessetValue:[numberFormatternumberFromString:[p objectAtIndex:3]] forKey:@“Low”];


        return multiDP;


    } else if (seriesIndex == 2) {

        [multiDP.yValuessetValue:[numberFormatternumberFromString:[p objectAtIndex:1]] forKey:@“Open”];

        [multiDP.yValuessetValue:[numberFormatternumberFromString:[p objectAtIndex:2]] forKey:@“High”];

        [multiDP.yValuessetValue:[numberFormatternumberFromString:[p objectAtIndex:3]] forKey:@“Low”];

        [multiDP.yValuessetValue:[numberFormatternumberFromString:[p objectAtIndex:4]] forKey:@“Close”];



        return multiDP;







It looks like the sticks are drawing to the wrong point - I’ve not seen this before, but I’ll raise a bug report to have it looked into.

I’ll let you know what we find.