一個簡單、漂亮的 iOS 圖表庫:PNChart

jopen 11年前發布 | 65K 次閱讀 PNChart 圖表/報表制作

簡單帶有動畫效果的圖表庫,在iOS應用中Piner中使用。


需要
PNChart支持iOS6.0以上系統,使用ARC。使用需要安裝以下框架:
Foundation
UIKit
CoreGraphics
QuartzCore


用法

復制PNChart文件夾到工程中
#import "PNChart.h"

  //For LineChart
  PNChart * lineChart = [[PNChart alloc] initWithFrame:CGRectMake(0, 75.0, SCREEN_WIDTH, 200.0)];
  [lineChart setXLabels:@[@"SEP 1",@"SEP 2",@"SEP 3",@"SEP 4",@"SEP 5"]];
  [lineChart setYValues:@[@"1",@"10",@"2",@"6",@"3"]];
  [lineChart strokeChart];

  //For BarChart
  PNChart * barChart = [[PNChart alloc] initWithFrame:CGRectMake(0, 75.0, SCREEN_WIDTH, 200.0)];
  barChart.type = PNBarType;
  [barChart setXLabels:@[@"SEP 1",@"SEP 2",@"SEP 3",@"SEP 4",@"SEP 5"]];
  [barChart setYValues:@[@"1",@"10",@"2",@"6",@"3"]];
  [barChart strokeChart];

  //By strokeColor you can change the chart color
  [barChart setStrokeColor:PN推terColor];

項目主頁:http://www.baiduhome.net/lib/view/home/1387101390687

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!