XJYChart - A High-performance, Elegant, Easy-to-integrate Charting Framework. The Best iOS Objc Charts.
相比于其他OC图表框架
XJYChart 做到了
- 图表滚动
- 折线图区域填充
- 触摸支持
- 显示动画
- 区域高亮
- LineChart
- BarChart
- PositiveNegativeBarChart
- PieChart
- CycleChart
- Animation
- Touch
- Scroll
- Beautiful
XJYChart is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "XJYChart"
Then, run the following command:
$ pod install
Qucikly Use
Eg: AreaLineExample BarChartExample CycleChartExample LineChartExample PieChartExample PositiveNegativeBarChartExample StackAreaLineChartExample
/**
@param frame frame
@param dataItemArray items
@param topNumbser top
@param bottomNumber buttom
@return instancetype
*/
XPositiveNegativeBarChart *barChart = [[XPositiveNegativeBarChart alloc] initWithFrame:CGRectMake(0, 0, 375, 200) dataItemArray:itemArray topNumber:@100 bottomNumber:@(-170)];
/**
@param numberArray data number in a line
@param color the line color
@return XLineChartItem instance
*/
- (instancetype)initWithDataNumberArray:(NSMutableArray *)numberArray color:(UIColor *)color;
- colorMode
+ lineMode
+ CurveLine
+ BrokenLine
- (instancetype)initWithFrame:(CGRect)frame dataItemArray:(NSMutableArray<XLineChartItem *> *)dataItemArray dataDiscribeArray:(NSMutableArray<NSString *> *)dataDiscribeArray topNumber:(NSNumber *)topNumbser bottomNumber:(NSNumber *)bottomNumber;
LineGraphMode: MutiLineGraph AreaLineGraph
XLineChart *lineChart = [[XLineChart alloc] initWithFrame:CGRectMake(0, 0, 375, 200) dataItemArray:itemArray dataDiscribeArray:[NSMutableArray arrayWithArray:@[@"January", @"February", @"March", @"April", @"May"]] topNumber:@200 bottomNumber:@0 graphMode:MutiLineGraph];
//XCycleView
- (instancetype)initWithFrame:(CGRect)frame;
XBarChart *barChart = [[XBarChart alloc] initWithFrame:CGRectMake(0, 0, 375, 200) dataItemArray:itemArray topNumber:@150 bottomNumber:@(0)];
- BarChartdelegate
- (void)touchBarAtIdx:(NSUInteger)idx;
self.pieChartView = [[XPieChart alloc] init];
NSMutableArray *pieItems = [[NSMutableArray alloc] init];
NSArray *colorArray = @[RGB(145, 235, 253), RGB(198, 255, 150), RGB(254, 248, 150), RGB(253, 210, 147)];
NSArray *dataArray = @[@"iPhone6",@"iPhone6 Plus",@"iPhone6s",@"其他"];
XPieItem *item1 = [[XPieItem alloc] initWithDataNumber:[NSNumber numberWithDouble:20.9] color:colorArray[0] dataDescribe:dataArray[0]];
[pieItems addObject:item1];
XPieItem *item2 = [[XPieItem alloc] initWithDataNumber:[NSNumber numberWithDouble:14.82] color:colorArray[1] dataDescribe:dataArray[1]];
[pieItems addObject:item2];
self.pieChartView.dataItemArray = pieItems;
Provide many colors In XColor.h ...
Added slippery graph And Chart Animations Example
+ .CurveLine
+ .AreaGraph
+ .StackAreaGraph
+ Add XCycleView
- touch
- gradient
Use XIB or Code
//XCycleView
- (instancetype)initWithFrame:(CGRect)frame;
- Clear abandoned API
+ Add The positive and negative Bar Chart**
XJYChart is available under the MIT license. See the LICENSE file for more info.