开发学院手机开发iPhone 开发 iphone上如何绘制点状图 阅读

iphone上如何绘制点状图

 2010-10-19 20:45:23 来源:WEB开发网   
核心提示:先上效果图:直接贴上完整的实现代码, 看不懂的地方自己google查询,iphone上如何绘制点状图,学习,CustomPolylineView.h01//create by suruiqiang 10.10.802#import 0304// 点状图05@interface CustomPolylineView :

先上效果图:

直接贴上完整的实现代码, 看不懂的地方自己google查询,学习。

CustomPolylineView.h

01//create by suruiqiang 10.10.8

02#import

03

04// 点状图

05@interface CustomPolylineView : UIView {

06

07 NSArray* dataSource;

08 NSMutableArray* dataSourceAfterPorcess;

09 float maxValue, minValue, averageScaleValue, columnWidth;

10 float standardValue;

11 int numberOfPlayedTimes,IntervalValue;

12 UIImage* ballImage;

13}

14@property(nonatomic, retain)NSArray* dataSource;

15@property(nonatomic, retain)NSMutableArray* dataSourceAfterPorcess;

16@property(nonatomic,assign)float standardValue;

17@end

CustomPolylineView.m

001//

002// CustomPolylineView.m

003// GolfSense

004//

005// Created by suruiqiang on 10/8/10.

006// Copyright 2010 __MyCompanyName__. All rights reserved.

007//

008

009#import "CustomPolylineView.h"

010#define MARGIN_LEFTSIDE 20

011#define MARGIN_BOTTOM_SIDE 20

012#define MARGIN_TOP_SIDE 10

013@interface CustomPolylineView(private)

014-(void)drawScale:(CGContextRef)context rect:(CGRect)_rect;

015-(void)calcScale:(CGRect)_rect;

016-(UIImage*)createImage;

017@end

018

019@implementation CustomPolylineView

020@synthesize dataSource;

021@synthesize dataSourceAfterPorcess;

022@synthesize standardValue;

023

024- (id)initWithFrame:(CGRect)frame {

025 if ((self = [super initWithFrame:frame])) {

026 // Initialization code

1 2 3 4 5  下一页

Tags:iphone 如何 绘制

编辑录入:爽爽 [复制链接] [打 印]
[]
  • 好
  • 好的评价 如果觉得好,就请您
      0%(0)
  • 差
  • 差的评价 如果觉得差,就请您
      0%(0)
更多精彩
    赞助商链接

    热点阅读
      焦点图片
        最新推荐
          精彩阅读