折线图 柱状图 UIBezierPath

原创
2016/08/09 10:12
阅读数 441

##折线图 柱状图 详情代码见github

柱状图效果 折线图效果

//使用代码
#import <UIKit/UIKit.h>
@class SNChart;
typedef NS_ENUM(NSInteger, SNChartStyle) {
    SNChartStyleLine = 0,
    SNChartStyleBar
};

@protocol SNChartDataSource <NSObject>

@required
//配置y轴 数值数组 数值设置图表 y轴标题显示
- (NSArray *)chatConfigYValue:(SNChart *)chart;
//配置x轴 横坐标标题
- (NSArray *)chatConfigXValue:(SNChart *)chart;

@end

@interface SNChart : UIView
/**
 *  @author sen, 15-12-24 17:12:50
 *
 *  line  是否曲线
 */
@property (nonatomic, assign) BOOL curve;

- (instancetype)initWithFrame:(CGRect)frame withDataSource:(id<SNChartDataSource>)dataSource andChatStyle:(SNChartStyle)chartStyle;

- (void)showInView:(UIView *)view;

@end

展开阅读全文
加载中

作者的其它热门文章

打赏
0
0 收藏
分享
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部