NTChartView *v = [[NTChartViewalloc] initWithFrame:CGRectMake(-20, 20, 480, 300)];
//要显示的数据
NTItems *g=[[NTItemsalloc] init];
NTItem *t1=[[NTItemalloc] initWithDouble:100];
[t1 AddData:500];
[t1 AddData:300];
t1.lable=@"2010年01月";
[g AddData:t1];
NTItem *t2=[[NTItemalloc] initWithDouble:800];
[t2 AddData:500];
[t2 AddData:300];
t2.lable=@"2010年02月";
[g AddData:t2];
NTItem *t3=[[NTItemalloc] initWithDouble:1000];
[t3 AddData:500];
[t3 AddData:300];
t3.lable=@"2010年03月";
[g AddData:t3];
NTItem *t4=[[NTItemalloc] initWithDouble:700];
[t4 AddData:800];
[t4 AddData:100];
t4.lable=@"2010年04月";
[g AddData:t4];
//要显示的颜色
[v AddGroupColor:0xFF0000];
[v AddGroupColor:0x04BE00];
[v AddGroupColor:0xFF00FF];
//绑定数据
v.groupData = g;
//修改背景sh色
UIColor *_color=[[UIColoralloc] initWithRed:0.8green:0.8blue:0.8alpha:1];
v.backcolor=_color;
v.delegate=self;
//是否打开点击提示信息
v.isTip=true;
//添加图例
NTLegend *legend=[[NTLegendalloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
[legend AddLengendString:@"2011计划值"];
[legend AddLengendString:@"2011实际值"];
[legend AddLengendString:@"2010计划值"];
//标题
//v.title=@"2011年计划/实际投资情况统计";
//设置图例
//[v setLegend:legend];
[self.viewinsertSubview:v atIndex:0];
[v release];
源代码下载地址 http://download.csdn.net/detail/sunjunqing/3804489
效果如下: