123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- //
- // DVBarChartView.h
- // xxxxx
- //
- // Created by Fire on 15/11/11.
- // Copyright © 2015年 DuoLaiDian. All rights reserved.
- //
- #import <UIKit/UIKit.h>
- #import "DVPlot.h"
- @class DVBarChartView;
- @protocol DVBarChartViewDelegate <NSObject>
- @optional
- - (void)barChartView:(DVBarChartView *)barChartView didSelectedBarAtIndex:(NSInteger)index;
- @end
- @interface DVBarChartView : UIView
- @property (weak, nonatomic) id<DVBarChartViewDelegate> delegate;
- /**
- * 文字大小
- */
- @property (strong, nonatomic) UIFont *textFont;
- /**
- * 文字颜色
- */
- @property (strong, nonatomic) UIColor *textColor;
- /**
- * x轴文字与坐标轴间隙
- */
- @property (assign, nonatomic) CGFloat xAxisTextGap;
- /**
- * 坐标轴颜色
- */
- @property (strong, nonatomic) UIColor *axisColor;
- /**
- * x轴的文字集合
- */
- @property (strong, nonatomic) NSArray *xAxisTitleArray;
- /**
- * 柱与柱之间的间距
- */
- @property (assign, nonatomic) CGFloat barGap;
- /**
- * 柱的宽度
- */
- @property (assign, nonatomic) CGFloat barWidth;
- /**
- * 柱的颜色
- */
- @property (strong, nonatomic) UIColor *barColor;
- /**
- * 柱的颜色
- */
- @property (strong, nonatomic) UIColor *barColor2;
- /**
- * 柱的颜色
- */
- @property (strong, nonatomic) UIColor *barColor3;
- /**
- * 柱的选中的颜色
- */
- @property (strong, nonatomic) UIColor *barSelectedColor;
- /**
- * 存放y轴数值的数组
- */
- @property (strong, nonatomic) NSMutableArray *xValues;
- /**
- * 存放第二组数据
- */
- @property (strong,nonatomic) NSMutableArray *xValues2;
- /**
- * 存放第三组数据
- */
- @property (strong,nonatomic) NSMutableArray *xValues3;
- /**
- * y值的标题数组
- */
- @property (strong, nonatomic) NSArray *xTitles;
- /**
- * y值的标题数组2
- */
- @property (strong, nonatomic) NSArray *xTitles2;
- /**
- * y值的标题数组3
- */
- @property (strong, nonatomic) NSArray *xTitles3;
- /**
- * y轴文字与坐标轴间隙
- */
- @property (assign, nonatomic) CGFloat yAxisTextGap;
- /**
- * y轴的最大值
- */
- @property (assign, nonatomic) CGFloat yAxisMaxValue;
- /**
- * y轴分为几段
- */
- @property (assign, nonatomic) int numberOfYAxisElements;
- /**
- * y轴与左侧的间距
- */
- @property (assign, nonatomic) CGFloat yAxisViewWidth;
- /**
- * y轴数值是否添加百分号
- */
- @property (assign, nonatomic, getter=isPercent) BOOL percent;
- /**
- * 是否显示点Label
- */
- @property (assign, nonatomic, getter=isShowPointLabel) BOOL showPointLabel;
- /**
- * 视图的背景颜色
- */
- @property (strong, nonatomic) UIColor *backColor;
- /**
- * 视图的背景颜色
- */
- @property (strong, nonatomic) UIColor *backColor2;
- /**
- * 视图的背景颜色
- */
- @property (strong, nonatomic) UIColor *backColor3;
- /**
- * 点是否允许点击
- */
- @property (assign, nonatomic, getter=isBarUserInteractionEnabled) BOOL barUserInteractionEnabled;
- /**
- * 标记选中哪一个柱子
- */
- @property (assign, nonatomic) NSInteger index;
- /**
- * 是否横屏
- */
- @property (assign,nonatomic,getter=isLandspace) BOOL landspace;
- /**
- * 是否是截图
- */
- @property (assign,nonatomic,getter=isShotImage) BOOL shotImage;
- /**
- * 图例名称 1
- */
- @property (strong,nonatomic) NSString *legendTitle1;
- /**
- * 图例名称 2
- */
- @property (strong,nonatomic) NSString *legendTitle2;
- /**
- * 快速创建方法
- */
- + (instancetype)barChartView;
- - (void)addPlot:(NSArray *)plot;
- - (void)removePlot;
- - (void)addPlot2:(NSArray *)plot;
- - (void)removePlot2;
- - (void)addPlot3:(NSArray *)plot;
- - (void)removePlot3;
- - (void)removeAllPlot;
- - (void)draw;
- -(void)selectedIndex:(NSInteger)index;
- @end
|