以前是经常在j2me提问题 ...
现在学iPhone了.又经常来到这里了.
呵呵.希望各位高手赐教;我打算做一个沪市大盘的 近30的数据的一个 K线
我这里已经有开高低收的数据了
我是这样定义的.const float high={2701.04,2710.739,2753,2759.439,2790.919,2805.05,2804.209,2819.06,2835.409,2906.26,2934.469,2924.189,2939.28,2924.229,2932.82,2944.409,2868.479,2881.54,2890.32,2906.169,2931.58,2924.959,2937.56,2944.459,3000.429,3001.62,3012.044,2995.768,2966.98,2966.98};
const float low={2661.449,2676.77,2677.209,2733.29,2748.54,2785.3,2764.87,2760.179,2807.61,2828.57,2892.639,2882.55,2905.03,2890.26,2884.189,2851.62,2839.199,2854.56,2848.649,2861.82,2901.55,2883.57,2900.76,2898.08,2952.719,2976.6,2989.342,2954.367,2927.683,2927.683};
const float open={2691.689,2677.169,2690.83,2741.31,2751.53,2795.07,2778.699,2769.649,2815.12,2828.57,2900.429,2893.679,2929.26,2924.229,2886.54,2941.32,2844.989,2861.389,2876.78,2880.169,2906.29,2905.51,2918.729,2902.189,2952.719,2996.729,3002.546,2995.768,2942.419,2942.419};
const float close={2677.429,2708.81,2749.149,2752.75,2790.689,2798.959,2774.07,2818.159,2827.33,2899.129,2899.239,2923.899,2926.959,2899.79,2932.25,2855.52,2862.629,2878.6,2878.57,2905.05,2918.919,2913.81,2902.979,2942.31,2996.209,2999.939,3002.154,2957.143,2933.796,2933.796};不知道这样定义一个数组有没有什么问题 .
然后怎么样转换这些数组才能画出K线 ...
求思路...

解决方案 »

  1.   

    opengl es中处理这个非常方便,而且如果你做这样的股票系统,一定需要界面实时的更新,需要更新性能比较好,那么opengl es就是为这个产生的。
    opengl es是一个大的话题,你到网上找点资料看看吧。
      

  2.   

    iphone支持quartz 2d画图,同样可以实现这个功能。一个例子代码,
    - (void)drawRect:(CGRect)rect {           CGContextRef context = UIGraphicsGetCurrentContext();           CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor);         CGContextSetRGBFillColor(context, 0.0, 0.0, 1.0, 1.0);          // Draw them with a 2.0 stroke width so they are a bit more visible.         CGContextSetLineWidth(context, 2.0);          for(int idx = 0; idx < self.points.count; idx++)         {              point = [self.points objectAtIndex:idx];//Edited              if(idx == 0)             {                 // move to the first point                 CGContextMoveToPoint(context, point.x, point.y);             }             else             {                 CGContextAddLineToPoint(context, point.x, point.y);             }         }          CGContextStrokePath(context); } 
      

  3.   

    关于quartz 2d,可以去看一下Stanford's CS193P class ,这个是学习iphone编程的最好的材料了,
      

  4.   

    http://www.stanford.edu/class/cs193p/cgi-bin/index.php