NGGraphView 0.1.1

NGGraphView 0.1.1

测试已测试
Lang语言 Obj-CObjective C
许可证 MIT
发布最后发布2014年12月

未指定 维护。



简单的图形视图。

DemoGif

要求

  • ARC。
  • iOS 6 或更高版本(已在 iOS 6 和 7 上测试)。

安装

手动

  1. NGGraphView 目录复制到您的项目中。

使用

#import "NGGraphView.h"
#import "NGDataPoint.h"
...
NGGraphView *_graphView; // add this to your view controller.

// you will want to set up an IBOutlet like so...
@property (nonatomic, retain) IBOutlet NGGraphView *graphView;

// next you will go to your view in interface builder
// add a new UIView, set the type to NGGraphView, and connect it 
// to this variable.

// finally you will want to initialize your graph view
// set it's properties to customize it's appearance
// and add some data to it...
[_graphView setTitle:@"My Test Graph"];
[_graphView setSubTitle:@"This is a test."];
[_graphView setLineColor:[UIColor blueColor]];
[_graphView setLineWidth:1.0];
[_graphView setSegments:5];  // this graph is divided up into five sections.
[_graphView setShowPoints:YES];
[_graphView setPointSize:7];
[_graphView setPointColor:[UIColor redColor]];
// now add some data, the NGDataPoint is used to add data to the graph view.
[_graphView addDataPoint:[NGDataPoint withLabel:@"first" andCount:3]];
[_graphView addDataPoint:[NGDataPoint withLabel:@"second" andCount:10]];
[_graphView addDataPoint:[NGDataPoint withLabel:@"third" andCount:7]];
[_graphView addDataPoint:[NGDataPoint withLabel:@"fourth" andCount:15]];
[_graphView addDataPoint:[NGDataPoint withLabel:@"fifth" andCount:19]];

自定义

属性

您可以自定义以下属性。

[_graphView setTitle:@"My Test Graph"];
[_graphView setSubTitle:@"This is a test."];
[_graphView setLineColor:[UIColor blueColor]];
[_graphView setLineWidth:1.0];
[_graphView setSegments:5];
[_graphView setShowPoints:YES];
[_graphView setPointSize:7];
[_graphView setPointColor:[UIColor redColor]];

作者

Nate Glenn, [email protected]

许可证

MIT