Candlestick with seconds data interval


#1

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.

http://img856.imageshack.us/img856/4951/t7k0.png

  • (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];

        NSLog(@“multiDP.xValue:%@”,multiDP.xValue);

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

        NSLog(@“dp.xValue:%@”,dp.xValue);

    

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

           NSLog(@“dp.yvalue:%@”,dp.yValue);

       // 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”];

         NSLog(@“multidp.yvalues:%@”,multiDP.yValues);

      

        return multiDP;

    }

    

    returnnil;

}


#2

Hi,

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.